Skip to contents

Support Vector Regression. Calls kernlab::ksvm() from kernlab.

Dictionary

This Learner can be instantiated via lrn():

lrn("regr.ksvm")

Meta Information

  • Task type: “regr”

  • Predict Types: “response”

  • Feature Types: “logical”, “integer”, “numeric”, “character”, “factor”, “ordered”

  • Required Packages: mlr3, mlr3extralearners, kernlab

Parameters

IdTypeDefaultLevelsRange
scaledlogicalTRUETRUE, FALSE-
typecharactereps-svreps-svr, nu-svr, eps-bsvr-
kernelcharacterrbfdotrbfdot, polydot, vanilladot, laplacedot, besseldot, anovadot-
Cnumeric1\((-\infty, \infty)\)
nunumeric0.2\([0, \infty)\)
epsilonnumeric0.1\((-\infty, \infty)\)
cacheinteger40\([1, \infty)\)
tolnumeric0.001\([0, \infty)\)
shrinkinglogicalTRUETRUE, FALSE-
sigmanumeric-\([0, \infty)\)
degreeinteger-\([1, \infty)\)
scalenumeric-\([0, \infty)\)
orderinteger-\((-\infty, \infty)\)
offsetnumeric-\((-\infty, \infty)\)
na.actionuntypedna.omit-
fitlogicalTRUETRUE, FALSE-

References

Karatzoglou, Alexandros, Smola, Alex, Hornik, Kurt, Zeileis, Achim (2004). “kernlab-an S4 package for kernel methods in R.” Journal of statistical software, 11(9), 1–20.

See also

Author

mboecker

Super classes

mlr3::Learner -> mlr3::LearnerRegr -> LearnerRegrKSVM

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

LearnerRegrKSVM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# Define the Learner
learner = mlr3::lrn("regr.ksvm")
print(learner)
#> <LearnerRegrKSVM:regr.ksvm>: Support Vector Machine
#> * Model: -
#> * Parameters: list()
#> * Packages: mlr3, mlr3extralearners, kernlab
#> * Predict Types:  [response]
#> * Feature Types: logical, integer, numeric, character, factor, ordered
#> * Properties: weights

# 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)
#> Support Vector Machine object of class "ksvm" 
#> 
#> SV type: eps-svr  (regression) 
#>  parameter : epsilon = 0.1  cost C = 1 
#> 
#> Gaussian Radial Basis kernel function. 
#>  Hyperparameter : sigma =  0.0776902224313652 
#> 
#> Number of Support Vectors : 16 
#> 
#> Objective Function Value : -4.3628 
#> Training error : 0.06533 


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

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