Python資料集模組

2021-08-20 16:20:49 字數 1290 閱讀 7375

scikit-learn 的 datasets 模組包含測試資料相關函式,主要包括三類:

fetch_california_housing(data_home=none, download_if_missing=true)

fetch_olivetti_faces(data_home=none, shuffle=false, random_state=0, download_if_missing=true):

olivetti 臉部資料集

fetch_lfw_people(data_home=none, funneled=true, resize=0.5, min_faces_per_person=0, color=false, slice_=(slice(70, 195, none), slice(78, 172, none)), download_if_missing=true):

fetch_lfw_pairs(subset='train', data_home=none, funneled=true, resize=0.5, color=false, slice_=(slice(70, 195, none), slice(78, 172, none)), download_if_missing=true):

labeled faces in the wild (lfw) 資料集,參考 lfw

fetch_20newsgroups(data_home=none, subset='train', categories=none, shuffle=true, random_state=42, remove=(), download_if_missing=true)

fetch_20newsgroups_vectorized(subset='train', remove=(), data_home=none):

新聞分類資料集,資料集包含 『train』 部分和 『test』 部分。

fetch_rcv1(data_home=none, subset='all', download_if_missing=true, random_state=none, shuffle=false):

路透社新聞語聊資料集

fetch_covtype(data_home=none, download_if_missing=true, random_state=none, shuffle=false)

forest covertypes 資料集

提供 svmlight / libsvm 格式資料的匯入或匯出。

uci machine learning repository:

uci kdd:

kaggle:

python案例資料集 Python資料集切分例項

在處理資料過程中經常要把資料集切分為訓練集和測試集,因此記錄一下切分 data 資料集 test ratio 測試機占比 如果data為numpy.numpy.ndarray直接使用此 如果data為pandas.datframe型別則 return data train indices data ...

python的os模組,切割檔案,資料集分割

os模組是對檔案 檔案路徑的乙個處理模組 1.判斷乙個檔案 路勁是否存在 os.path.exists path 返回乙個布林量,存在則返回1,否則則返回0。2.新建乙個資料夾 os.makedirs path path是乙個路徑,包括你的檔名3.os.walk 方法是乙個簡單易用的檔案 目錄遍歷器...

(python學習)資料集

1.imagedata imagedata的點在三維等間距上 引數說明 origin 三維網路資料的起點座標 spacing 三維網路資料在x,y,z軸上的間距 dimensions 在x,y,z軸上的網格 舉例 img tvtk.imagedata spacing 1,1,1 origin 1,2...