predict.wap {costsensitive} | R Documentation |
Predict method for Weighted All-Pairs
Description
Predicts either the class with expected minimum cost or scores (more is better) for new data.
Usage
## S3 method for class 'wap'
predict(object, newdata, type = "class",
criterion = "most-wins", ...)
Arguments
object |
An object of class 'wap' as output by function 'weighted.all.pairs'. |
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). |
criterion |
One of "goodness" (will use the sum of probabilities output by each classifier) or "most-wins" (will use the predicted class by each classifier). |
... |
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 'matrix' with the same number of columns as 'C' (passed to the 'weighted.all.pairs' function) and the predicted score for each observation and class.