predict.wovr {costsensitive} | R Documentation |
Predict method for Weighted One-Vs-Rest
Description
Predicts either the class with expected minimum cost or scores (more is better) for new data.
Usage
## S3 method for class 'wovr'
predict(object, newdata, type = "class", ...)
Arguments
object |
An object of class 'wovr' as output by function 'weighted.one.vs.rest'. |
newdata |
New data on which to make predictions. |
type |
One of "class" (will output the class with minimum expected cost) or "score" (will output the predicted score for each class, i.e. more is better). |
... |
Additional arguments to pass to the predict method of the base classifier. |
Value
When passing 'type = "class"', a vector with class numbers or names (if the cost matrix had them). When passing 'type = "score"', will output a 'data.frame' with the same number of columns as 'C' (passed to the 'weighted.one.vs.rest' function) and the predicted score for each observation and class.
[Package costsensitive version 0.1.2.10 Index]