response {mlearning}R Documentation

Get the response variable for a mlearning object

Description

The response is either the class to be predicted for a classification problem (and it is a factor), or the dependent variable in a regression model (and it is numeric in that case). For unsupervised classification, response is not provided and should return NULL.

Usage

response(object, ...)

## Default S3 method:
response(object, ...)

Arguments

object

an object having a response variable.

...

further parameter (depends on the method).

Value

The response variable of the training set, or NULL for unsupervised classification.

See Also

mlearning(), train(), confusion()

Examples

data("HouseVotes84", package = "mlbench")
house_rf <- ml_rforest(data = HouseVotes84, Class ~ .)
house_rf
response(house_rf)

[Package mlearning version 1.2.1 Index]