culebra.tools.decision_manager.LexicographicWithRepeatedCVDM class¶
- class LexicographicWithRepeatedCVDM(trainer: Trainer, obj_thresholds: float | None = None, cv_repeats: int | None = None)¶
Bases:
LexicographicDMInit the decesion manager.
- Parameters:
trainer (Trainer) – The trainer
obj_thresholds (float) – Similarity thresholds for fitness values. If omitted,
_default_similarity_thresholdis used. Defaults toNonecv_repeats (int) – Number of cross-validation repeats. If omitted,
_default_cv_repeatsis used. Defaults toNone
Class methods¶
- classmethod LexicographicWithRepeatedCVDM.load(filename: str) Base¶
Load a serialized object from a file.
- Parameters:
filename (str) – The file name.
- Returns:
The loaded object
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
Properties¶
- property LexicographicWithRepeatedCVDM.cv_repeats: int¶
Number of cross-validation repeats.
- Return type:
- Setter:
Set a new value for the number of cross-validation repeats
- Parameters:
value (int) – A positive integer value. If set to
None,_default_cv_repeatsis assumed- Raises:
TypeError – If value is not an integer value
ValueError – If value is not positive
- property LexicographicWithRepeatedCVDM.obj_thresholds: tuple[float]¶
Objective similarity thresholds.
- Return type:
- Setter:
Set new thresholds.
- Parameters:
values (float | Sequence[float]) – The new values. If only a single value is provided, the same threshold will be used for all the objectives. Different thresholds can be provided in a
Sequence. If set toNone, all the thresholds are set to_default_similarity_threshold- Raises:
TypeError – If neither a real number nor a
Sequenceof real numbers is providedValueError – If any value is negative
ValueError – If the length of the thresholds sequence does not match the number of objectives
Private properties¶
- property LexicographicWithRepeatedCVDM._default_cv_repeats: int¶
Default number of repeats for cross-validation.
- Returns:
- Return type:
Methods¶
- LexicographicWithRepeatedCVDM.dump(filename: str) None¶
Serialize this object and save it to a file.
- Parameters:
filename (str) – The file name.
- Raises:
TypeError – If filename is not a valid file name
ValueError – If the filename extension is not
SERIALIZED_FILE_EXTENSION
Private methods¶
- LexicographicWithRepeatedCVDM._choose(all_combinations: list[list[Solution, ...]], all_combinations_fitness: list[Fitness, ...]) tuple[Solution, ...] | None¶
Choose one combination of solutions.
The combinations are ranked lexicographically and the first one is selected.
- LexicographicWithRepeatedCVDM._evaluate(all_combinations: list[list[Solution, ...]]) list[Fitness, ...]¶
Evaluate all the combinations of Pareto optimal solutions.
The trainer’s training fitness function is used to perform a repeated cross-validaton process.
- LexicographicWithRepeatedCVDM._generate_all_combinations() list[list[Solution, ...]]¶
Generate all the combinations of Pareto optimal solutions.

