predict.wovr: Predict method for Weighted One-Vs-Rest

Description Usage Arguments Value

View source: R/wovr.R

Description

Predicts either the class with expected minimum cost or scores (more is better) for new data.

Usage

1
2
## 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.


costsensitive documentation built on July 28, 2019, 5:02 p.m.