The class is responsible of managing the whole process. Concretely builds the M.L. models (optimizes models hyperparameters), selects the best M.L. model for each cluster and executes the classification stage.
new()The function is used to initialize all parameters needed to build a Multiple Classifier System.
D2MCS$new(
dir.path,
num.cores = NULL,
socket.type = "PSOCK",
outfile = NULL,
serialize = FALSE
)dir.pathA character defining location were the trained models should be saved.
num.coresAn optional numeric value specifying the number of CPU cores used for training the models (only if parallelization is allowed). If not defined (num.cores - 2) cores will be used.
socket.typeA character value defining the type of socket
used to communicate the workers. The default type, "PSOCK", calls
makePSOCKcluster. Type "FORK" calls makeForkCluster. For more
information see makeCluster
outfileWhere to direct the stdout and stderr connection output from the workers. "" indicates no redirection (which may only be useful for workers on the local machine). Defaults to '/dev/null'
serializeA logical value. If TRUE (default)
serialization will use XDR: where large amounts of data are to be
transferred and all the nodes are little-endian, communication may be
substantially faster if this is set to false.
train()The function is responsible of performing the M.L. model training stage.
D2MCS$train(
train.set,
train.function,
num.clusters = NULL,
model.recipe = DefaultModelFit$new(),
ex.classifiers = c(),
ig.classifiers = c(),
metrics = NULL,
saveAllModels = FALSE
)train.setA Trainset object used as training input
for the M.L. models
train.functionA TrainFunction defining the training
configuration options.
num.clustersAn numeric value used to define the number of
clusters from the Trainset that should be utilized during
the training stage. If not defined all clusters will we taken into
account for training.
model.recipeAn unprepared recipe object inherited from
GenericModelFit class.
ex.classifiersA character vector containing the name of
the M.L. models used in training stage. See
getModelInfo and
https://topepo.github.io/caret/available-models.html for more
information about all the available models.
ig.classifiersA character vector containing the name of
the M.L. that should be ignored when performing the training stage. See
getModelInfo and
https://topepo.github.io/caret/available-models.html for more
information about all the available models.
metricsA character vector containing the metrics used to
perform the M.L. model hyperparameter optimization during the training
stage. See SummaryFunction, UseProbability
and NoProbability for more information.
saveAllModelsA logical parameter. A TRUE saves all trained models while A FALSE saves only the M.L. model achieving the best performance on each cluster.
A TrainOutput object containing all the information
computed during the training stage.
classify()The function is responsible for executing the classification stage.
D2MCS$classify(train.output, subset, voting.types, positive.class = NULL)train.outputThe TrainOutput object computed in the
train stage.
subsetA Subset containing the data to be classified.
voting.typesA list containing SingleVoting
or CombinedVoting objects.
positive.classAn optional character parameter used to define the positive class value.
A ClassificationOutput with all the values computed
during classification stage.
getAvailableModels()The function obtains all the available M.L. models.
D2MCS$getAvailableModels()A data.frame containing the information of the available M.L. models.
clone()The objects of this class are cloneable with this method.
D2MCS$clone(deep = FALSE)deepWhether to make a deep clone.
Dataset, Subset, Trainset