Learn R Programming

mlearning (version 1.2.1)

response: 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, ...)

# S3 method for default response(object, ...)

Value

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

Arguments

object

an object having a response variable.

...

further parameter (depends on the method).

See Also

mlearning(), train(), confusion()

Examples

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

Run the code above in your browser using DataLab