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

1
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

Author(s)

Jan Saputra Mueller

See Also

rde_loocv, rde_tcm, estnoise

Examples

1
2
3
4
5
6
## 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!