Description Usage Arguments Value Examples
Calcurate suggention for each inputs based on prediction
1 |
esrules |
an object returned by set.eSatisfactory(). |
forest |
an object of ensemble trees to be parsed. See |
newdata |
a data.frame or matrix. test data to be predicted and to be suggested. newdata must have the same structure of train data. |
label.from |
a character. Predicted class label that user wants to change. |
label.to |
a character. Class label that user wants to be changed from |
.dopar |
logical. If |
a list of
"predict" character vector of predicted label of each instance. See predict.randomForest
.
"original" is the same as newdata
.
"suggest" a data.frame of instances tweakd from newdata.
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
X <- iris[, 1:(ncol(iris)-1)]
scaled.X <- scale(X)
true.y <- iris[, ncol(iris)]
rf.iris <- randomForest(X, true.y, ntree=30)
rules.rf <- getRules(rf.iris, ktree = 20)
es.rf <- set.eSatisfactory(forest.rf, ntree = 30, epsiron = 0.3, resample = TRUE)
tweaked <- tweak(es.rf, newdata= scaled.X, label.from = "spam", label.to = "nonspam",
.dopar = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.