liquidSVM (version 1.2.2)

mlr-liquidSVM: liquidSVM functions for mlr

Description

Allow for liquidSVM lsSVM and mcSVM to be used in the mlr framework.

Usage

makeRLearner.regr.liquidSVM()

trainLearner.regr.liquidSVM(.learner, .task, .subset, .weights = NULL, partition_choice = 0, partition_param = -1, ...)

predictLearner.regr.liquidSVM(.learner, .model, .newdata, ...)

makeRLearner.classif.liquidSVM()

trainLearner.classif.liquidSVM(.learner, .task, .subset, .weights = NULL, partition_choice = 0, partition_param = -1, ...)

predictLearner.classif.liquidSVM(.learner, .model, .newdata, ...)

Arguments

.learner

see mlr-Documentation

.task

see mlr-Documentation

.subset

see mlr-Documentation

.weights

see mlr-Documentation

partition_choice

the partition choice, see Configuration

partition_param

a further param for partition choice, see Configuration

...

other parameters, see Configuration

.model

the trained mlr-model, see mlr-Documentation

.newdata

the test features, see mlr-Documentation

Examples

Run this code
# NOT RUN {
if(require(mlr)){
library(liquidSVM)

## Define a regression task
task <- makeRegrTask(id = "trees", data = trees, target = "Volume")
## Define the learner
lrn <- makeLearner("regr.liquidSVM", display=1)
## Train the model use mlr::train to get the correct train function
model <- train(lrn,task)
pred <- predict(model, task=task)
performance(pred)

## Define a classification task
task <- makeClassifTask(id = "iris", data = iris, target = "Species")

## Define the learner
lrn <- makeLearner("classif.liquidSVM", display=1)
model <- train(lrn,task)
pred <- predict(model, task=task)
performance(pred)

## or for probabilities
lrn <- makeLearner("classif.liquidSVM", display=1, predict.type='prob')
model <- train(lrn,task)
pred <- predict(model, task=task)
performance(pred)

} # end if(require(mlr))
# }

Run the code above in your browser using DataLab