'min_impurity_split',
'min_samples_leaf',
'min_samples_split',
'min_weight_fraction_leaf',
'n_classes_',
'n_features_',
'n_outputs_',
'predict',
'predict_log_proba',
'predict_proba',
'presort',
'random_state',
'score',
'set_params',
'splitter',
'transform',
'tree_']
下面开始进行蘑菇分类。本书提供的蘑菇数据如表3-5所示,包含样本编号和特征属性,其中第一行是类别标记及属性名称,第一列为样本编号。
表3-5
该表共包含8123条数据,特征属性共有22个,这些属性及其对应的取值含义如下所示。
类别标记:
毒蘑菇,poisonous,p
可食用,edible,e
特征属性及取值
-shape:bell=b,conical=c,convex=x,flat=f,knobbed=k,sunken=s
-surface:fibrous=f,grooves=g,scaly=y,smooth=s
-color:brown=n,buff=b,cinnamon=c,gray=g,green=r,pink=p,purple=u,red=e,white=w,yellow=y
:bruises=t,no=f
:almond=a,anise=l,creosote=c,fishy=y,foul=f,musty=m,none=n,pungent=p,spicy=s
-attachment:attached=a,descending=d,free=f,notched=n
-spacing:close=c,crowded=w,distant=d
-size:broad=b,narrow=n
-color:black=k,brown=n,buff=b,chocolate=h,gray=g,green=r,orange=o,pink=p,purple=u,red=e,white=w,yellow=y
-shape:enlarging=e,tapering=t
-root:bulbous=b,club=c,cup=u,equal=e,rhizomorphs=z,rooted=r,missing=?
-surface-above-ring:fibrous=f,scaly=y,silky=k,smooth=s
-surface-below-ring:fibrous=f,scaly=y,silky=k,smooth=s
-color-above-ring:brown=n,buff=b,cinnamon=c,gray=g,orange=o,pink=p,red=e,white=w,yellow=y
-color-below-ring:brown=n,buff=b,cinnamon=c,gray=g,orange=o,pink=p,red=e,white=w,yellow=y
-type:partial=p,universal=u