Learn R Programming

MLPUGS (version 0.2.0)

ecc: Fit an Ensemble of Classifier Chains (ECC)

Description

Constructs an ensemble of classifier chains, each chain using a user-supplied base classifier.

Usage

ecc(x, y, m = 5, prop_subset = 0.95, run_parallel = FALSE, silent = TRUE, .f = NULL, ...)

Arguments

x
A data frame or matrix of features.
y
A data frame or matrix of labels. Each label must be its own column and each instance (observation) must be a row of 0s and 1s, indicating which labels belong to the instance.
m
Number of classifier chains (models) to train. Recommended: m = 3 and m = 7 for 4-core and 8-core systems, respectively.
prop_subset
The proportion of the training data to utilize when m is greater than 1. Each set of classifier chains in the ensemble will use a random subset (95% by default) of the supplied training data.
run_parallel
Whether to utilize multicore capabilities of the system.
silent
Whether to print progress messages to console. Recommended.
.f
User-supplied classifier training function. If not supplied, the trainer will use the built-in classifier. See Details for more information.
...
additional arguments to pass to .f.

Value

An object of class ECC containing:
  • y_labels : names of the columns of y
  • fits : An list of length m, each element being a set of classifier chains - a list of length L = ncol(y) where each element is a fitted model object trained to predict each of the L labels.

Examples

Run this code
x <- movies_train[, -(1:3)]
y <- movies_train[, 1:3]

fit <- ecc(x, y, m = 1, .f = glm.fit, family = binomial(link = "logit"))

## Not run: 
# 
# fit <- ecc(x, y, .f = randomForest::randomForest)
# 
# fit <- ecc(x, y, m = 7, .f = C50::C5.0, trials = 10)
# ## End(Not run)

Run the code above in your browser using DataLab