选取iris数据集,且对数据进行简单的探索和处理
初步结论:
##
## Call:
## C5.0.default(x = df_raw[-5], y = df_raw$Species)
##
##
## C5.0 [Release 2.07 GPL Edition] Mon May 20 23:15:39 2019
## -------------------------------
##
## Class specified by attribute `outcome'
##
## Read 150 cases (5 attributes) from undefined.data
##
## Decision tree:
##
## Petal.Length <= 1.9: setosa (50)
## Petal.Length > 1.9:
## :...Petal.Width > 1.7: virginica (46/1)
## Petal.Width <= 1.7:
## :...Petal.Length <= 4.9: versicolor (48/1)
## Petal.Length > 4.9: virginica (6/2)
##
##
## Evaluation on training data (150 cases):
##
## Decision Tree
## ----------------
## Size Errors
##
## 4 4( 2.7%) <<
##
##
## (a) (b) (c) <-classified as
## ---- ---- ----
## 50 (a): class setosa
## 47 3 (b): class versicolor
## 1 49 (c): class virginica
##
##
## Attribute usage:
##
## 100.00% Petal.Length
## 66.67% Petal.Width
##
##
## Time: 0.0 secs
##
## Call:
## C5.0.default(x = df_raw_copy[-5], y = df_raw_copy$Species)
##
##
## C5.0 [Release 2.07 GPL Edition] Mon May 20 23:15:39 2019
## -------------------------------
##
## Class specified by attribute `outcome'
##
## Read 150 cases (6 attributes) from undefined.data
##
## Decision tree:
##
## Petal.Length <= 1.9: setosa (50)
## Petal.Length > 1.9:
## :...Petal.Width > 1.7: virginica (46/1)
## Petal.Width <= 1.7:
## :...Petal.Length <= 4.9: versicolor (48/1)
## Petal.Length > 4.9: virginica (6/2)
##
##
## Evaluation on training data (150 cases):
##
## Decision Tree
## ----------------
## Size Errors
##
## 4 4( 2.7%) <<
##
##
## (a) (b) (c) <-classified as
## ---- ---- ----
## 50 (a): class setosa
## 47 3 (b): class versicolor
## 1 49 (c): class virginica
##
##
## Attribute usage:
##
## 100.00% Petal.Length
## 66.67% Petal.Width
##
##
## Time: 0.0 secs
##
## Call:
## C5.0.default(x = df_raw_copy_sort[-6], y = df_raw_copy_sort$Species)
##
##
## C5.0 [Release 2.07 GPL Edition] Mon May 20 23:15:39 2019
## -------------------------------
##
## Class specified by attribute `outcome'
##
## Read 150 cases (6 attributes) from undefined.data
##
## Decision tree:
##
## Petal.Length.Copy <= 1.9: setosa (50)
## Petal.Length.Copy > 1.9:
## :...Petal.Width > 1.7: virginica (46/1)
## Petal.Width <= 1.7:
## :...Petal.Length.Copy <= 4.9: versicolor (48/1)
## Petal.Length.Copy > 4.9: virginica (6/2)
##
##
## Evaluation on training data (150 cases):
##
## Decision Tree
## ----------------
## Size Errors
##
## 4 4( 2.7%) <<
##
##
## (a) (b) (c) <-classified as
## ---- ---- ----
## 50 (a): class setosa
## 47 3 (b): class versicolor
## 1 49 (c): class virginica
##
##
## Attribute usage:
##
## 100.00% Petal.Length.Copy
## 66.67% Petal.Width
##
##
## Time: 0.0 secs