Learn R Programming

rdetools (version 1.0)

isregression: Estimate from labels whether this is a regression problem

Description

Estimates whether this is a regression or classification problem by looking at the labels. If all labels are only -1 and 1 a classification problem is assumed, otherwise a regression problem. If the argument 'regression' is TRUE, the function always returns TRUE.

Usage

isregression(y, regression = FALSE)

Arguments

y
label vector for which the kind of problem should be estimated
regression
if regression is TRUE, the function returns always TRUE, if you want an estimation leave this FALSE

Value

TRUE, if this is a regression problem or the argument regression was TRUE, otherwise FALSE

See Also

rde_loocv, rde_tcm, estnoise

Examples

Run this code
## some examples
y_cl <- c(-1, 1, 1, -1, 1) # label vector for classification problem
y_reg <- runif(5) # label vector for regression problem
isregression(y_cl) # FALSE!
isregression(y_cl, regression = TRUE) # Always TRUE!
isregression(y_reg) # TRUE!

Run the code above in your browser using DataLab