classifiers

class thefittest.classifiers.GeneticProgrammingClassifier(*, n_iter: int = 300, pop_size: int = 1000, functional_set_names: ~typing.Tuple[str, ...] = ('cos', 'sin', 'add', 'sub', 'mul', 'div'), optimizer: ~typing.Type[~thefittest.optimizers._selfcgp.SelfCGP] | ~typing.Type[~thefittest.optimizers._geneticprogramming.GeneticProgramming] = <class 'thefittest.optimizers._selfcgp.SelfCGP'>, optimizer_args: dict[str, ~typing.Any] | None = None, random_state: int | ~numpy.random.mtrand.RandomState | None = None)

Methods

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

set_params(**params)

Set the parameters of this estimator.

set_score_request(*[, sample_weight])

Request metadata passed to the score method.

fit

get_stats

get_tree

predict

predict_proba

predict(X: ndarray[Any, dtype[float64]])
predict_proba(X: ndarray[Any, dtype[float64]])
set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') GeneticProgrammingClassifier

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to score if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to score.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

New in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
sample_weightstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED

Metadata routing for sample_weight parameter in score.

Returns:
selfobject

The updated object.

class thefittest.classifiers.GeneticProgrammingNeuralNetClassifier(*, n_iter: int = 15, pop_size: int = 50, input_block_size: int = 1, max_hidden_block_size: int = 9, offset: bool = True, test_sample_ratio: float = 0.5, optimizer: ~typing.Type[~thefittest.optimizers._selfcgp.SelfCGP] | ~typing.Type[~thefittest.optimizers._geneticprogramming.GeneticProgramming] = <class 'thefittest.optimizers._selfcgp.SelfCGP'>, optimizer_args: dict[str, ~typing.Any] | None = None, weights_optimizer: ~typing.Type[~thefittest.optimizers._differentialevolution.DifferentialEvolution] | ~typing.Type[~thefittest.optimizers._jde.jDE] | ~typing.Type[~thefittest.optimizers._shade.SHADE] | ~typing.Type[~thefittest.optimizers._geneticalgorithm.GeneticAlgorithm] | ~typing.Type[~thefittest.optimizers._selfcga.SelfCGA] | ~typing.Type[~thefittest.optimizers._shaga.SHAGA] = <class 'thefittest.optimizers._shade.SHADE'>, weights_optimizer_args: dict[str, ~typing.Any] | None = None, net_size_penalty: float = 0.0, random_state: int | ~numpy.random.mtrand.RandomState | None = None)

Methods

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

set_params(**params)

Set the parameters of this estimator.

set_score_request(*[, sample_weight])

Request metadata passed to the score method.

fit

genotype_to_phenotype_tree

get_net

get_stats

get_tree

predict

predict_proba

predict(X: ndarray[Any, dtype[float64]])
predict_proba(X: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]
set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') GeneticProgrammingNeuralNetClassifier

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to score if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to score.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

New in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
sample_weightstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED

Metadata routing for sample_weight parameter in score.

Returns:
selfobject

The updated object.

class thefittest.classifiers.MLPEAClassifier(*, n_iter: int = 200, pop_size: int = 500, hidden_layers: ~typing.Tuple[int, ...] = (0, ), activation: str = 'sigma', offset: bool = True, weights_optimizer: ~typing.Type[~thefittest.optimizers._differentialevolution.DifferentialEvolution] | ~typing.Type[~thefittest.optimizers._jde.jDE] | ~typing.Type[~thefittest.optimizers._shade.SHADE] | ~typing.Type[~thefittest.optimizers._geneticalgorithm.GeneticAlgorithm] | ~typing.Type[~thefittest.optimizers._selfcga.SelfCGA] | ~typing.Type[~thefittest.optimizers._shaga.SHAGA] = <class 'thefittest.optimizers._shade.SHADE'>, weights_optimizer_args: dict[str, ~typing.Any] | None = None, random_state: int | ~numpy.random.mtrand.RandomState | None = None)

Methods

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

score(X, y[, sample_weight])

Return the mean accuracy on the given test data and labels.

set_params(**params)

Set the parameters of this estimator.

set_score_request(*[, sample_weight])

Request metadata passed to the score method.

fit

get_net

get_stats

predict

predict_proba

predict(X: ndarray[Any, dtype[float64]])
predict_proba(X: ndarray[Any, dtype[float64]]) ndarray[Any, dtype[float64]]
set_score_request(*, sample_weight: bool | None | str = '$UNCHANGED$') MLPEAClassifier

Request metadata passed to the score method.

Note that this method is only relevant if enable_metadata_routing=True (see sklearn.set_config()). Please see User Guide on how the routing mechanism works.

The options for each parameter are:

  • True: metadata is requested, and passed to score if provided. The request is ignored if metadata is not provided.

  • False: metadata is not requested and the meta-estimator will not pass it to score.

  • None: metadata is not requested, and the meta-estimator will raise an error if the user provides it.

  • str: metadata should be passed to the meta-estimator with this given alias instead of the original name.

The default (sklearn.utils.metadata_routing.UNCHANGED) retains the existing request. This allows you to change the request for some parameters and not others.

New in version 1.3.

Note

This method is only relevant if this estimator is used as a sub-estimator of a meta-estimator, e.g. used inside a Pipeline. Otherwise it has no effect.

Parameters:
sample_weightstr, True, False, or None, default=sklearn.utils.metadata_routing.UNCHANGED

Metadata routing for sample_weight parameter in score.

Returns:
selfobject

The updated object.