predict.DecisionTreeClassifier.RdSimilar to other predict methods, this function predicts fitted values from a fitted "DecisionTreeClassifier" object.
# S3 method for DecisionTreeClassifier predict(model, data, key, features = NULL, verbose = NULL, thread.ratio = NULL)
| model |
|
|---|---|
| data |
|
| key |
|
| features |
|
| verbose |
|
| thread.ratio |
|
S3 methods
Dataframe
Predicted values, structured as follows.
ID column, with same name and type as data's ID column.
SCORE, type NVARCHAR(100), predicted classes.
CONFIDENCE, type DOUBLE. Representing the confidence of a class
Input DataFrame data2:
> data2$Collect() ID OUTLOOK HUMIDITY TEMP WINDY 1 0 Overcast 75.0 70 Yes 2 1 Rain 78.0 70 Yes 3 2 Sunny 66.0 70 Yes 4 3 Sunny 69.0 70 Yes 5 4 Rain NA 70 Yes 6 5 <NA> 70.0 70 Yes 7 6 *** 70.0 70 Yes
Call the function and obtain the result:
> result = predict(dtc, data2, verbose=FALSE) ID SCORE CONFIDENCE 1 0 Play 1.000000 2 1 Do not Play 1.000000 3 2 Play 1.000000 4 3 Play 1.000000 5 4 Do not Play 1.000000 6 5 Play 0.692308 7 6 Play 0.692308