predict.NSmodel {utiml} | R Documentation |
Predict Method for Nested Stacking
Description
This function predicts values based upon a model trained by ns
.
The scores of the prediction was adapted once this method uses a correction
of labelsets to predict only classes present on training data. To more
information about this implementation see subset_correction
.
Usage
## S3 method for class 'NSmodel'
predict(
object,
newdata,
probability = getOption("utiml.use.probs", TRUE),
...,
cores = NULL,
seed = getOption("utiml.seed", NA)
)
Arguments
object |
Object of class ' |
newdata |
An object containing the new input data. This must be a matrix, data.frame or a mldr object. |
probability |
Logical indicating whether class probabilities should be
returned. (Default: |
... |
Others arguments passed to the base algorithm prediction for all subproblems. |
cores |
Ignored because this method does not support multi-core. |
seed |
An optional integer used to set the seed.
(Default: |
Value
An object of type mlresult, based on the parameter probability.
See Also
Examples
model <- ns(toyml, "RANDOM")
pred <- predict(model, toyml)
# Predict SVM bipartitions
pred <- predict(model, toyml, probability = FALSE)
# Passing a specif parameter for SVM predict algorithm
pred <- predict(model, toyml, na.action = na.fail)