cluster
takes data
and processes it using pre
(if
supplied). clusterer
is called to cluster the data. For each cluster, the
best algorithm is identified according to the criteria given in bestBy
.
If bestBy
is "performance", the best algorithm is the one with the best
overall performance across all instances in the cluster. If it is "count", the
best algorithm is the one that has the best performance most often. If it is
"successes", the best algorithm is the one with the highest number of successes
across all instances in the cluster. The learned model is used to cluster the
test data and predict algorithms accordingly.
The evaluation across the training and test sets will be parallelized
automatically if a suitable backend for parallel computation is loaded.
The parallelMap
level is "llama.fold".
If a list of clusterers is supplied in clusterer
, ensemble
clustering is performed. That is, the models are trained and used to make
predictions independently. For each instance, the final prediction is determined
by majority vote of the predictions of the individual models -- the class that
occurs most often is chosen. If the list given as clusterer
contains a
member .combine
that is a function, it is assumed to be a classifier with
the same properties as classifiers given to classify
and will be used to
combine the ensemble predictions instead of majority voting. This classifier is
passed the original features and the predictions of the classifiers in the
ensemble.
If all predictions of an underlying machine learning model are NA
, the
prediction will be NA
for the algorithm and -Inf
for the score if
the performance value is to be maximised, Inf
otherwise.
If save.models
is not NA
, the models trained during evaluation are
serialized into files. Each file contains a list with members model
(the
mlr model), train.data
(the mlr task with the training data), and
test.data
(the data frame with the test data used to make predictions).
The file name starts with save.models
, followed by the ID of the machine
learning model, followed by "combined" if the model combines predictions of
other models, followed by the number of the fold. Each model for each fold is
saved in a different file.