Skip to contents

Get the N best models from a classifier result for each k-sparsity.

Usage

getNBestModels(
  obj,
  significance = FALSE,
  by.k.sparsity = TRUE,
  k.penalty = 0,
  n.best = 5,
  single.best = FALSE,
  single.best.cv = TRUE,
  single.best.k = NULL,
  max.min.prevalence = FALSE,
  X = NULL,
  verbose = FALSE,
  evalToOrder = "fit_",
  return.population = FALSE,
  unique.control = TRUE
)

Arguments

obj:

the classifier result output from the function fit. This can also be a ModelCollection or Population object

significance:

if TRUE, (default:FALSE) a statistical test will be applied to find the lowest threshold that will delimit the window of the best models. If FALSE, the models will be selected according to the rest of the criteria.

by.k.sparsity:

if TRUE (default:TRUE), the filtering will be performed for each sparsity level

k.penalty:

(default:0), it will penalize the models with large sparsity if different, when by.k.sparsity is set to TRUE

n.best:

the number of best models to be returned for each sparsity if by.k.sparsity is set to TRUE or for the whole population otherwise (default:5).

nbest:

the number of best models we wish to get from the population, per each sparsity or not. If there are less best models then this number, less will be returned

single.best:

if TRUE, this will return the best model of all (default:FALSE) and the n.best will be set to 1.

single.best.cv:

if single.best is TRUE, we could chose the best model based on data from cross validation (default:TRUE) and in this case obj should be an experiment or from empirical results not in CV.

single.best.k:

if single.best is TRUE, we could chose the best model of a given sparsity that is specified by a number here. If this value is specified (default:NULL), then this will de-actvate single.best.cv.

max.min.prevalence:

if TRUE (default:FALSE), the best models will be selected based on their performance but also on the prevalence of the features that compose it.

X:

the dataset to be learned (default:NULL). This is neeeded when max.min.prevalence is set to TRUE.

verbose:

provide more information about execution (default = FALSE)

evalToOrder:

which attribute of the model object should we use to order the models and select them (default:fit_)

return.population:

if set to TRUE (default:FALSE), the result will be send as a population of models

unique.control:

if set to TRUE (default:TRUZ), we correct the population so that no dupplication of models takes place

Value

a list of model objects or a model when it is a single one or a model collection