Predict Method for Ensemble of Binary Relevance

Share:

Description

This method predicts values based upon a model trained by ebr.

Usage

1
2
3
4
## S3 method for class 'EBRmodel'
predict(object, newdata, vote.schema = "maj",
  probability = getOption("utiml.use.probs", TRUE), ...,
  cores = getOption("utiml.cores", 1), seed = getOption("utiml.seed", NA))

Arguments

object

Object of class 'EBRmodel'.

newdata

An object containing the new input data. This must be a matrix, data.frame or a mldr object.

vote.schema

Define the way that ensemble must compute the predictions. The default valid options are: c("avg", "maj", "max", "min"). If NULL then all predictions are returned. (Default: 'maj')

probability

Logical indicating whether class probabilities should be returned. (Default: getOption("utiml.use.probs", TRUE))

...

Others arguments passed to the base method prediction for all subproblems.

cores

The number of cores to parallelize the training. Values higher than 1 require the parallel package. (Default: options("utiml.cores", 1))

seed

An optional integer used to set the seed. This is useful when the method is run in parallel. (Default: options("utiml.seed", NA))

Value

An object of type mlresult, based on the parameter probability.

See Also

Ensemble of Binary Relevance (EBR) Compute Multi-label Predictions

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
# Predict SVM scores
model <- ebr(toyml)
pred <- predict(model, toyml)

# Predict SVM bipartitions running in 6 cores
pred <- predict(model, toyml, prob = FALSE, cores = 6)

# Return the classes with the highest score
pred <- predict(model, toyml, vote = 'max')

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.