culebra.fitness_function.cooperative.FSSVCScorer class¶
- class FSSVCScorer(*objectives: tuple[SingleObjectiveFitnessFunction, ...])¶
Bases:
MultiObjectiveFitnessFunctionConstruct a cooperative multi-objective fitness function.
All the objectives that analyze a dataset must be
FSClassificationScorerinstances using anSVCwith RBF kernels. That is, noRBFSVCScorerobjectives are allowed.- Parameters:
objectives (tuple[SingleObjectiveFitnessFunction]) – Objectives for this fitness function
Class methods¶
- classmethod FSSVCScorer.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 FSSVCScorer.obj_thresholds: list[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
- property FSSVCScorer.objectives: tuple[SingleObjectiveFitnessFunction]¶
Objectives to be optimized.
- Return type:
Private properties¶
Methods¶
- FSSVCScorer.construct_solutions(sol: Solution, index: int | None = None, representatives: Sequence[Solution] | None = None) tuple[Solution, ...]¶
Assemble the solution and representatives.
This fitness function assumes that:
representatives[0]: Codes the SVC hyperparameters (C and gamma). Thus, it is an instance of
culebra.solution.parameter_optimization.Solutionrepresentatives[1:]: The remaining solutions code the features selected, each solution a different range of features. All of them are instances of
culebra.solution.feature_selection.Solution
- Parameters:
- Returns:
The solutions to the different problems solved cooperatively
- Return type:
- FSSVCScorer.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
- FSSVCScorer.evaluate(sol: Solution, index: int | None = None, representatives: Sequence[Solution] | None = None) Fitness¶
Evaluate a solution.
It is assumed that:
representatives[0]: Codes the SVC hyperparameters (C and gamma). Thus, it is an instance of
culebra.solution.parameter_optimization.Solutionrepresentatives[1:]: The remaining solutions code the features selected, each solution a different range of features. All of them are instances of
culebra.solution.feature_selection.Solution
- Parameters:
- Returns:
The fitness for sol
- Return type:

