Fitness and validation masks¶
EvoDAG.bagging_fitness¶
It splits the training data into the part used to evolve and the validation part, builds the masks used by the least-squares weights, and computes the fitness of an individual on each part.
- class BaggingFitness[source]¶
Computes the fitness on the training and validation sets of the nodes created by an EvoDAG object.
- assert_fitness_function()[source]¶
Check that the fitness function of the base object is one of the supported ones.
- property nclasses¶
Number of classes (3 for orthogonal or agreement selection in regression).
- property score¶
Score object used to compute the classification measures, created on first use.
- property min_class¶
Index of the least frequent class, computed on first use.
- mask_fitness_BER(k)[source]¶
Return the training mask that keeps the same number of validation examples in each class.
- mask_fitness_function(k)[source]¶
Return the training mask for the classes k, which depends on the fitness function.
- set_classifier_mask(v, base_mask=True)[source]¶
Computes the mask used to create the training and validation set
- transform_to_mo(v)[source]¶
Convert the labels v into a matrix with one column per class, with 1 for the class and -1 otherwise.
- multiple_outputs_cl(v)[source]¶
Set the targets, masks and labels of the base object for a classification with multiple outputs.
- multiple_outputs_regression(v)[source]¶
Set the targets and masks of the base object for a regression with multiple outputs.