Skip to contents

L2 regularized support vector regression. Calls LiblineaR::LiblineaR() from LiblineaR.

Details

Type of SVR depends on type argument:

  • type = 11 - L2-regularized L2-loss support vector regression (primal)

  • type = 12 – L2-regularized L2-loss support vector regression (dual)

  • type = 13 – L2-regularized L1-loss support vector regression (dual)

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.liblinear")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “integer”, “numeric”

  • Required Packages: mlr3, mlr3extralearners, LiblineaR

Parameters

IdTypeDefaultLevelsRange
typeinteger11\([11, 13]\)
costnumeric1\([0, \infty)\)
biasnumeric1\((-\infty, \infty)\)
svr_epsnumericNULL\([0, \infty)\)
crossinteger0\([0, \infty)\)
verboselogicalFALSETRUE, FALSE-
findClogicalFALSETRUE, FALSE-
useInitClogicalTRUETRUE, FALSE-

Initial parameter values

  • svr_eps:

    • Actual default: NULL

    • Initial value: 0.001

    • Reason for change: svr_eps is type dependent and the "type" is handled by the mlr3learner. The default value is set to th default of the respective "type".

References

Fan, Rong-En, Chang, Kai-Wei, Hsieh, Cho-Jui, Wang, Xiang-Rui, Lin, Chih-Jen (2008). “LIBLINEAR: A library for large linear classification.” the Journal of machine Learning research, 9, 1871–1874.

See also

Author

be-marc

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrLiblineaR

Methods

Inherited methods


Method new()

Creates a new instance of this R6 class.

Usage


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerRegrLiblineaR$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = mlr3::lrn("regr.liblinear")
print(learner)
#> <LearnerRegrLiblineaR:regr.liblinear>: Support Vector Machine
#> * Model: -
#> * Parameters: svr_eps=0.001
#> * Packages: mlr3, mlr3extralearners, LiblineaR
#> * Predict Types:  [response]
#> * Feature Types: integer, numeric
#> * Properties: -

# Define a Task
task = mlr3::tsk("mtcars")

# Create train and test set
ids = mlr3::partition(task)

# Train the learner on the training ids
learner$train(task, row_ids = ids$train)

print(learner$model)
#> $TypeDetail
#> [1] "L2-regularized L2-loss support vector regression primal (L2R_L2LOSS_SVR)"
#> 
#> $Type
#> [1] 11
#> 
#> $W
#>              am      carb       cyl        disp      drat      gear         hp
#> [1,] 0.04749603 0.0056256 0.1439871 -0.03330341 0.2126691 0.1973808 0.04270183
#>           qsec        vs         wt       Bias
#> [1,] 0.9788553 0.0628559 0.06269929 0.04951328
#> 
#> $Bias
#> [1] 1
#> 
#> $NbClass
#> [1] 2
#> 
#> attr(,"class")
#> [1] "LiblineaR"


# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)

# Score the predictions
predictions$score()
#> regr.mse 
#> 21.80698