2017-12-30

project checklist

frame the problem

select a performance measure

RMSE:均方誤差根
MAE: 平均絕對(duì)誤差
范數(shù)越大對(duì)大特征值更有效,會(huì)忽略小特征值,但數(shù)據(jù)正態(tài)分布時(shí),RSEM性能更好。

Download and load the data

Take a quick look at the data strucure

data.head()

data.info()
data[‘a(chǎn)ttribute’].value_counts()
data.describe()
也可以畫直方圖來了解各個(gè)數(shù)字型屬性的分布
data.hist(bins = 50,figsize=(20,15))

create a test set

random select
from sklearn.model_selection import train_test_split
train_set,test_set = train_test_split(data,test_size = 0.2, random_state = 42)
stratified sampling通過對(duì)分組屬性進(jìn)行分層采樣劃分
from sklearn.model_selection import StratifiedShuffleSplit
spliter = StratifiedShuffleSplit(n_splits = 1,test_size = 0.2,random_state = 42)
for train_index,test_index in spliter.split(data,data[‘category’]):
strat_train_set = data.loc[train_index]
start_test_set = data.loc[test_index]

exploring the data:discover and visualize the data to gain insights

visualizing geographical data
housing.plot(kind = ’scatter’,x= ‘longitude’,y = ‘latitude’ ,alpha = 0.4,s = housing[‘population’]/100,label = ‘population’,c = “median_house_value”,camp = plt.get_cmap(“jet”),colorbar = Ture)
plt.legend()

looking for correlations

corr_mattix = housing.corr()

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容

  • project checklist frame the problem select a performance ...
    陸文斌閱讀 206評(píng)論 0 0
  • 愛情是什么呢?愛一個(gè)人你是如何去面對(duì)自己和那個(gè)TA,(我愛你)經(jīng)常掛在嘴邊,直到有一天,有心中發(fā)出愛的光芒,只是去...
    那一日閱讀 105評(píng)論 0 0
  • 我用冷漠懲罰我過于單純的過往 這樣的冷漠其實(shí)還微微發(fā)燙 好像一把靠在角落的舊傘 只有陰雨天才變得繁忙 可它并不悲傷...
    烏荊子閱讀 323評(píng)論 0 1
  • 第十章 公正的評(píng)判一本書 我們學(xué)會(huì)主動(dòng)的閱讀不會(huì)為了已經(jīng)了解一本書在說什么而停頓下來,必須能評(píng)論,提出批評(píng),才算...
    星期六1111閱讀 228評(píng)論 0 0
  • 排序算法 直接插入排序 基本思想 在要排序的一組數(shù)中,假設(shè)前面(n-1) [n>=2]個(gè)數(shù)已經(jīng)是排好順序的,現(xiàn)在要...
    忘凈空閱讀 364評(píng)論 0 0