test.liquidSVM: Tests new data using the selected SVM.

Description Usage Arguments Details Value Documentation for command-line parameters of svm-test See Also Examples

View source: R/liquidSVM.R

Description

After training and selection the SVM provides means to evaluate labels for new input features. If you do not have labels consider using predict.liquidSVM. The errors for all tasks and cells are returned attached to the result (see errors).

Usage

1
2
3
## S3 method for class 'liquidSVM'
test(model, newdata, labels = NULL,
  command.args = NULL, ..., d = NULL)

Arguments

model

the SVM model as returned by init.liquidSVM

newdata

data frame of features to predict. If it has all the explanatory variables of formula, then the respective subset is taken. NAs will be removed.

labels

the known labels to test against. If NULL then they are retrieved from newdata using the original formula.

command.args

further arguments aranged in a list, corresponding to the arguments of the command line interface to svm-select, e.g. list(d=2,R=0) is equivalent to svm-select -d 2 -R 0. See command-args for details.

...

other configuration parameters passed to testing phase

d

level of display information

Details

If the SVM has multiple tasks the result will have corresponding columns. For mcSVM the first column gives the global vote and the other columns give the result for the corresponding binary classification problem indicated by the column name.

For convenience the latest result is always saved in model$last_result.

Value

predictions for all tasks together with errors (see errors). This is also recorded in model$last_result.

Documentation for command-line parameters of svm-test

The following parameters can be used as well:



See Also

command-args, init.liquidSVM, errors

Examples

1
2
3
modelTrees <- svm(Height ~ Girth + Volume, trees[1:10, ])  # least squares
result <- test(modelTrees, trees[11:31, ], trees$Height[11:31])
errors(result)

Example output

sh: 1: grep: Permission denied
sh: 1: /bin/cat: Permission denied
sh: 1: grep: Permission denied
sh: 1: /bin/cat: Permission denied
Warning message:
In (function (model, command.args = NULL, ..., d = NULL, warn.suboptimal = getOption("liquidSVM.warn.suboptimal",  :
  Solution may not be optimal: try training again using max_gamma=25
val_error 
 50.09717 

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