mlr_learners_classif.liblinear | R Documentation |
L2 regularized support vector classification.
Calls LiblineaR::LiblineaR()
from LiblineaR.
Type of SVC depends on type
argument:
0
– L2-regularized logistic regression (primal)
1
- L2-regularized L2-loss support vector classification (dual)
3
- L2-regularized L1-loss support vector classification (dual)
2
– L2-regularized L2-loss support vector classification (primal)
4
– Support vector classification by Crammer and Singer
5
- L1-regularized L2-loss support vector classification
6
- L1-regularized logistic regression
7
- L2-regularized logistic regression (dual)
If number of records > number of features, type = 2
is faster than type = 1
(Hsu et al. 2003).
Note that probabilistic predictions are only available for types 0
, 6
, and 7
.
The default epsilon
value depends on the type
parameter, see LiblineaR::LiblineaR.
This Learner can be instantiated via lrn():
lrn("classif.liblinear")
Task type: “classif”
Predict Types: “response”, “prob”
Feature Types: “numeric”
Required Packages: mlr3, mlr3extralearners, LiblineaR
Id | Type | Default | Levels | Range |
type | integer | 0 | [0, 7] |
|
cost | numeric | 1 | [0, \infty) |
|
epsilon | numeric | - | [0, \infty) |
|
bias | numeric | 1 | (-\infty, \infty) |
|
cross | integer | 0 | [0, \infty) |
|
verbose | logical | FALSE | TRUE, FALSE | - |
wi | untyped | NULL | - | |
findC | logical | FALSE | TRUE, FALSE | - |
useInitC | logical | TRUE | TRUE, FALSE | - |
mlr3::Learner
-> mlr3::LearnerClassif
-> LearnerClassifLiblineaR
new()
Creates a new instance of this R6 class.
LearnerClassifLiblineaR$new()
clone()
The objects of this class are cloneable with this method.
LearnerClassifLiblineaR$clone(deep = FALSE)
deep
Whether to make a deep clone.
be-marc
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.
Dictionary of Learners: mlr3::mlr_learners.
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.
# Define the Learner
learner = mlr3::lrn("classif.liblinear")
print(learner)
# Define a Task
task = mlr3::tsk("sonar")
# 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)
# Make predictions for the test rows
predictions = learner$predict(task, row_ids = ids$test)
# Score the predictions
predictions$score()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.