lsSVM: Least Squares Regression

Description Usage Arguments Details Value Examples

View source: R/scenarios.R

Description

This routine performs non-parametric least squares regression using SVMs. The tested estimators are therefore estimating the conditional means of Y given X. svmRegression is a simple alias of lsSVM.

Usage

1
2
3
lsSVM(x, y, ..., clipping = -1, do.select = TRUE)

svmRegression(x, y, ..., clipping = -1, do.select = TRUE)

Arguments

x

either a formula or the features

y

either the data or the labels corresponding to the features x. It can be a character in which case the data is loaded using liquidData. If it is of type liquidData then after training and selection the model is tested using the testing data (y$test).

...

configuration parameters, see Configuration. Can be threads=2, display=1, gpus=1, etc.

clipping

absolute value where the estimated labels will be clipped. -1 (the default) leads to an adaptive clipping value, whereas 0 disables clipping.

do.select

if TRUE also does the whole selection for this model

Details

This is the default for svm if the labels are not a factor.

Value

an object of type svm. Depending on the usage this object has also $train_errors, $select_errors, and $last_result properties.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
tt <- ttsplit(quakes)
model <- lsSVM(mag~., tt$train, display=1)
result <- test(model, tt$test)

errors(result) ## is the same as
mean( (tt$test$mag-result)^2 )

## End(Not run)

Example output

sh: 1: /bin/cat: Permission denied
sh: 1: grep: Permission denied
sh: 1: /bin/cat: Permission denied
sh: 1: grep: Permission denied

Welcome to SVM train (dim=4 size=800 decision_functions=0 cookie=1)
liquidSVM-train -r 1 -s -1 -S 1 -P 0 -f 3 5 -g 10 0.200000 5.000000 -l 10 0.001000 0.010000 -a 0 -L 2 -d 1 -T 0 -GPU 0 
Assigning samples to cells for task 0.

Considering cell 1 out of 1 for task 1 out of 1.
Fold 1: training set size 640,   validation set size 160.
Fold 2: training set size 640,   validation set size 160.
Fold 3: training set size 640,   validation set size 160.
Fold 4: training set size 640,   validation set size 160.
Fold 5: training set size 640,   validation set size 160.
tpt: 0.01  tbt: 0.15  tnt: 0.01   vpt: 0.00  vbt: 0.07   it: 0.001  tt: 0.061  vt: 0.035   ii:     500  ti:   57617  tu:  115234  vi: 114401   h2D: 0.079

Welcome to SVM select (dim=4 size=800 decision_functions=0 cookie=1)
liquidSVM-select -R 1 -d 1 

Considering cell 1 out of 1 for task 1 out of 1.
Fold 1: best validation error 0.1219.
Fold 2: best validation error 0.1303.
Fold 3: best validation error 0.1485.
Fold 4: best validation error 0.0956.
Fold 5: best validation error 0.1422.

Warning: The best gamma was 0 times at the lower boundary and 5 times at the
upper boundary of your gamma grid. 5 times a gamma value was selected.
Warning message:
In selectSVMs(model) :
  Solution may not be optimal: try training again using max_gamma=25

Welcome to SVM test (using SVM with dim=4 trained on size=800 decision_functions=5 cookie=1)
liquidSVM-test -L 2 -v 1 1 -d 1 -T 0 -GPU 0 
Task 1: Test error 0.1270.
val_error 
0.1270483 
[1] 0.1270483

liquidSVM documentation built on Sept. 15, 2019, 1:02 a.m.