L2-Regularized Support Vector Regression Learner
mlr_learners_regr.liblinear.Rd
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)
Meta Information
Task type: “regr”
Predict Types: “response”
Feature Types: “integer”, “numeric”
Required Packages: mlr3, mlr3extralearners, LiblineaR
Parameters
Id | Type | Default | Levels | Range |
type | integer | 11 | \([11, 13]\) | |
cost | numeric | 1 | \([0, \infty)\) | |
bias | numeric | 1 | \((-\infty, \infty)\) | |
svr_eps | numeric | NULL | \([0, \infty)\) | |
cross | integer | 0 | \([0, \infty)\) | |
verbose | logical | FALSE | TRUE, FALSE | - |
findC | logical | FALSE | TRUE, FALSE | - |
useInitC | logical | TRUE | TRUE, 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
as.data.table(mlr_learners)
for a table of available Learners in the running session (depending on the loaded packages).Chapter in the mlr3book: https://mlr3book.mlr-org.com/basics.html#learners
mlr3learners for a selection of recommended learners.
mlr3cluster for unsupervised clustering learners.
mlr3pipelines to combine learners with pre- and postprocessing steps.
mlr3tuning for tuning of hyperparameters, mlr3tuningspaces for established default tuning spaces.
Super classes
mlr3::Learner
-> mlr3::LearnerRegr
-> LearnerRegrLiblineaR
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.03604225 0.02100413 0.1064741 -0.01997582 0.1920986 0.1958378 0.03483255
#> qsec vs wt Bias
#> [1,] 0.8674276 0.05261902 0.06191837 0.04362511
#>
#> $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
#> 42.85487