response: Get the response variable for a mlearning object

View source: R/response.R

responseR 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)

mlearning documentation built on Aug. 31, 2023, 1:09 a.m.