predict.rovr {costsensitive}R Documentation

Predict method for Regression One-Vs-Rest

Description

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

Usage

## S3 method for class 'rovr'
predict(object, newdata, type = "class", ...)

Arguments

object

An object of class 'rovr' as output by function 'regression.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 cost for each class, i.e. less is better).

...

Additional arguments to pass to the predict method of the base regressor.

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 'regression.one.vs.rest' function) and the predicted cost for each observation and class.


[Package costsensitive version 0.1.2.10 Index]