機(jī)器學(xué)習(xí)經(jīng)典開(kāi)源數(shù)據(jù)集
2018-06-13 來(lái)源:

數(shù)據(jù)為王,使用相同機(jī)器學(xué)習(xí)算法,不同質(zhì)量的數(shù)據(jù)能訓(xùn)練出不同效果的模型。本文將分享數(shù)據(jù)科學(xué)領(lǐng)域中經(jīng)典的幾個(gè)開(kāi)源數(shù)據(jù)集。
正文分三部分:
詳細(xì)介紹最常用的幾個(gè)經(jīng)典數(shù)據(jù)集
介紹如何使用 Python 優(yōu)雅地觀察數(shù)據(jù)集
其它開(kāi)源數(shù)據(jù)集的獲取方式
0x01 經(jīng)典數(shù)據(jù)集
一、概述
下面表格中是居士整理的一些最常用的數(shù)據(jù)集,基本上能用于整個(gè)機(jī)器學(xué)習(xí)的過(guò)程中,這些數(shù)據(jù)集也頻繁地出現(xiàn)在sklearn、spark ml、tenserfolw的官方示例中。

二、Iris
This is perhaps the best known database to be found in the pattern recognition literature. Fisher’s paper is a classic in the field and is referenced frequently to this day. (See Duda & Hart, for example.) The data set contains 3 classes of 50 instances each, where each class refers to a type of iris plant. One class is linearly separable from the other 2; the latter are NOT linearly separable from each other.
Iris也稱鳶尾花卉數(shù)據(jù)集,是一類多重變量分析的數(shù)據(jù)集。是由杰出的統(tǒng)計(jì)學(xué)家R.A.Fisher在20世紀(jì)30年代中期創(chuàng)建的,它被公認(rèn)為用于數(shù)據(jù)挖掘的最著名的數(shù)據(jù)集。它包含3種植物種類(Iris setosa、Iris versicolor和Iris virginica),每種各有50個(gè)樣本。它由4個(gè)屬性組成:sepal length(花萼長(zhǎng)度)、sepal width(花萼寬度)、petal length(花瓣長(zhǎng)度)和petal width(花瓣寬度)(單位是cm)。
三、Adult
Extraction was done by Barry Becker from the 1994 Census database. A set of reasonably clean records was extracted using the following conditions: ((AAGE>16) && (AGI>100) && (AFNLWGT>1)&& (HRSWK>0)) Prediction task is to determine whether a person makes over 50K a year.
該數(shù)據(jù)從美國(guó)1994年人口普查數(shù)據(jù)庫(kù)抽取而來(lái),可以用來(lái)預(yù)測(cè)居民收入是否超過(guò)50K$/year。該數(shù)據(jù)集類變量為年收入是否超過(guò)50k$,屬性變量包含年齡,工種,學(xué)歷,職業(yè),人種等重要信息,值得一提的是,14個(gè)屬性變量中有7個(gè)類別型變量。
四、Wine
These data are the results of a chemical analysis of wines grown in the same region in Italy but derived from three different cultivars. The analysis determined the quantities of 13 constituents found in each of the three types of wines. I think that the initial data set had around 30 variables, but for some reason I only have the 13 dimensional version. I had a list of what the 30 or so variables were, but a.) I lost it, and b.), I would not know which 13 variables are included in the set.
這份數(shù)據(jù)集包含來(lái)自3種不同起源的葡萄酒的共178條記錄。13個(gè)屬性是葡萄酒的13種化學(xué)成分。通過(guò)化學(xué)分析可以來(lái)推斷葡萄酒的起源。值得一提的是所有屬性變量都是連續(xù)變量。
五、20 Newsgroups
The 20 Newsgroups data set is a collection of approximately 20,000 newsgroup documents, partitioned (nearly) evenly across 20 different newsgroups.
該數(shù)據(jù)集包含大約20000個(gè)新聞組文檔,在20個(gè)不同的新聞組中平均分配,是一個(gè)文本分類的經(jīng)典數(shù)據(jù)集,它是機(jī)器學(xué)習(xí)技術(shù)的文本應(yīng)用中的實(shí)驗(yàn)的流行數(shù)據(jù)集,如文本分類和文本聚類。
六、MovieLens
MovieLens 數(shù)據(jù)集是一個(gè)關(guān)于電影評(píng)分的數(shù)據(jù)集,里面包含了從IMDB, The Movie DataBase上面得到的用戶對(duì)電影的評(píng)分信息。該數(shù)據(jù)集可以用于推薦系統(tǒng)。
七、MNIST
MNIST數(shù)據(jù)集機(jī)器學(xué)習(xí)領(lǐng)域內(nèi)用于手寫(xiě)字識(shí)別的數(shù)據(jù)集,數(shù)據(jù)集中包含6個(gè)萬(wàn)訓(xùn)練集、10000個(gè)示例測(cè)試集。,每個(gè)樣本圖像的寬高為28*28。這些數(shù)據(jù)集的大小已經(jīng)歸一化,并且形成固定大小,因此預(yù)處理工作基本已經(jīng)完成。在機(jī)器學(xué)習(xí)中,主流的機(jī)器學(xué)習(xí)工具(包括sklearn)很多都使用該數(shù)據(jù)集作為入門(mén)級(jí)別的介紹和應(yīng)用。
0x02 數(shù)據(jù)探索
關(guān)于數(shù)據(jù)的詳細(xì)信息,對(duì)它最好的理解方式不是看文檔,而是自己去看數(shù)據(jù)的分布和特性。
理解數(shù)據(jù)
在這里我們以鳶尾花數(shù)據(jù)集為例,使用Python的pandas來(lái)描述,關(guān)于鳶尾花數(shù)據(jù)集的獲取,我們直接使用sklearn提供的api,不在自己下載。
1.數(shù)據(jù)獲取和描述

2.數(shù)據(jù)示例

3.數(shù)據(jù)描述
數(shù)據(jù)描述,使用describe可以看數(shù)據(jù)集的各個(gè)維度的描述,比如維度的總量,平均值等。

這里只是簡(jiǎn)單地做個(gè)示例,想深入看的話,可以在官網(wǎng)查看詳細(xì)的api。
0x03 其它
一、UCI數(shù)據(jù)集
UCI數(shù)據(jù)集中包括了眾多用于監(jiān)督式和非監(jiān)督式學(xué)習(xí)的數(shù)據(jù)集,數(shù)量大概400多個(gè),其中很多數(shù)據(jù)集在其他眾多數(shù)據(jù)工具中被反復(fù)引用,例如Iris、Wine、Adult、Car Evaluation、Forest Fires等。
地址:http://archive.ics.uci.edu/ml/
二、sklearn的datasets
sklearn中已經(jīng)自帶了很多的數(shù)據(jù)集,比如前面用到datasets.load_iris()就是sklearn自帶數(shù)據(jù)集,感興趣的可以直接在官網(wǎng)中查看相應(yīng)的api,包含了大部分常用的數(shù)據(jù)集。
地址:http://scikit-learn.org/stable/modules/classes.html#module-sklearn.datasets
標(biāo)簽: 數(shù)據(jù)庫(kù)
版權(quán)申明:本站文章部分自網(wǎng)絡(luò),如有侵權(quán),請(qǐng)聯(lián)系:west999com@outlook.com
特別注意:本站所有轉(zhuǎn)載文章言論不代表本站觀點(diǎn)!
本站所提供的圖片等素材,版權(quán)歸原作者所有,如需使用,請(qǐng)與原作者聯(lián)系。