Description Usage Arguments Note Examples
Allow for liquidSVM lsSVM
and mcSVM
to be used in the mlr
framework.
1 2 3 4 5 6 7 8 9 10 11 12 13 | 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, ...)
|
.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 |
In order that mlr can find our learners liquidSVM has to be loaded
using e.g. library(liquidSVM)
model <- train(...)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | ## 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))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.