Description Usage Arguments Details Value Author(s) References See Also Examples
Predict cases or probabilities based on OneR model object.
1 2 |
object |
object of class |
newdata |
data frame in which to look for the feature variable with which to predict. |
type |
character string denoting the type of predicted value returned. Default |
... |
further arguments passed to or from other methods. |
newdata
can have the same format as used for building the model but must at least have the feature variable that is used in the OneR rules.
If cases appear that were not present when building the model the predicted case is UNSEEN
or NA
when "type = prob"
.
The default is a factor with the predicted classes, if "type = prob"
a matrix is returned whose columns are the probability of the first, second, etc. class.
Holger von Jouanne-Diedrich
1 2 3 4 5 6 7 | model <- OneR(iris)
prediction <- predict(model, iris[1:4])
eval_model(prediction, iris[5])
## type prob
predict(model, data.frame(Petal.Width = seq(0, 3, 0.5)))
predict(model, data.frame(Petal.Width = seq(0, 3, 0.5)), type = "prob")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.