Learn R Programming

liquidSVM (version 1.2.4)

predict.liquidSVM: Predicts labels of new data using the selected SVM.

Description

After training and selection the SVM provides means to compute predictions for new input features. If you have also labels consider using test.liquidSVM.

Usage

# S3 method for liquidSVM
predict(object, newdata, ...)

Arguments

object

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.

...

other parameters passed to test.liquidSVM

Value

the predicted values of test

Details

In the multi-result learning scenarios this returns all the predictions corresponding to the different quantiles, expectiles, etc. For multi-class classification, if the model was setup with predict.prob=TRUE Then this will return only the probability columns and not the prediction.

See Also

init.liquidSVM and test.liquidSVM

Examples

Run this code
# NOT RUN {
## Multiclass classification
modelIris <- svm(Species ~ ., iris)
y <- predict(modelIris, iris)

## Least Squares
modelTrees <- svm(Height ~ Girth + Volume, trees)
y <- predict(modelTrees, trees)
plot(trees$Height, y)
# }

Run the code above in your browser using DataLab