Skip to content

Commit

Permalink
Update TPOT2 in docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-m-dev committed Dec 11, 2024
1 parent 1f953b3 commit 42d378c
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 37 deletions.
10 changes: 5 additions & 5 deletions tpot2/evolvers/steady_state_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def ind_mutate(ind, rng):
Parameters
----------
ind : tpot2.BaseIndividual
ind : tpot.BaseIndividual
The individual to mutate
rng : int or numpy.random.Generator
A numpy random generator to use for reproducibility
Expand All @@ -71,8 +71,8 @@ def ind_crossover(ind1, ind2, rng):
Calls the ind1.crossover(ind2, rng=rng)
Parameters
----------
ind1 : tpot2.BaseIndividual
ind2 : tpot2.BaseIndividual
ind1 : tpot.BaseIndividual
ind2 : tpot.BaseIndividual
rng : int or numpy.random.Generator
A numpy random generator to use for reproducibility
"""
Expand Down Expand Up @@ -219,7 +219,7 @@ def __init__( self,
periodic_checkpoint_folder : str, default=None
Folder to save the population to periodically. If None, no periodic saving will be done.
If provided, training will resume from this checkpoint.
callback : tpot2.CallBackInterface, default=None
callback : tpot.CallBackInterface, default=None
Callback object. Not implemented
rng : Numpy.Random.Generator, None, default=None
An object for reproducability of experiments. This value will be passed to numpy.random.default_rng() to create an instnce of the genrator to pass to other classes
Expand All @@ -231,7 +231,7 @@ def __init__( self,
Attributes
----------
population : tpot2.Population
population : tpot.Population
The population of individuals.
Use population.population to access the individuals in the current population.
Use population.evaluated_individuals to access a data frame of all individuals that have been explored.
Expand Down
2 changes: 1 addition & 1 deletion tpot2/search_spaces/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def unique_id(self):
"""
return self

#TODO currently TPOT2 population class manually uses the unique_id to generate the index for the population data frame.
#TODO currently TPOT population class manually uses the unique_id to generate the index for the population data frame.
#alternatively, the index could be the individual itself, with the __eq__ and __hash__ methods implemented.

# Though this breaks the graphpipeline. When a mutation is called, it changes the __eq__ and __hash__ outputs.
Expand Down
2 changes: 1 addition & 1 deletion tpot2/search_spaces/tuple_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

class TupleIndex():
"""
TPOT2 uses tuples to create a unique id for some pipeline search spaces. However, tuples sometimes don't interact correctly with pandas indexes.
TPOT uses tuples to create a unique id for some pipeline search spaces. However, tuples sometimes don't interact correctly with pandas indexes.
This class is a wrapper around a tuple that allows it to be used as a key in a dictionary, without it being an itereable.
An alternative could be to make unique id return a string, but this would not work with graphpipelines, which require a special object.
Expand Down
12 changes: 6 additions & 6 deletions tpot2/tpot_estimator/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def __init__(self,
Parameters
----------
search_space : (String, tpot2.search_spaces.SearchSpace)
search_space : (String, tpot.search_spaces.SearchSpace)
- String : The default search space to use for the optimization.
| String | Description |
| :--- | :----: |
Expand All @@ -157,7 +157,7 @@ def __init__(self,
- SearchSpace : The search space to use for the optimization. This should be an instance of a SearchSpace.
The search space to use for the optimization. This should be an instance of a SearchSpace.
TPOT2 has groups of search spaces found in the following folders, tpot2.search_spaces.nodes for the nodes in the pipeline and tpot2.search_spaces.pipelines for the pipeline structure.
TPOT has groups of search spaces found in the following folders, tpot.search_spaces.nodes for the nodes in the pipeline and tpot.search_spaces.pipelines for the pipeline structure.
scorers : (list, scorer)
A scorer or list of scorers to be used in the cross-validation process.
Expand Down Expand Up @@ -205,7 +205,7 @@ def __init__(self,
categorical_features: list or None
Categorical columns to inpute and/or one hot encode during the preprocessing step. Used only if preprocessing is not False.
- None : If None, TPOT2 will automatically use object columns in pandas dataframes as objects for one hot encoding in preprocessing.
- None : If None, TPOT will automatically use object columns in pandas dataframes as objects for one hot encoding in preprocessing.
- List of categorical features. If X is a dataframe, this should be a list of column names. If X is a numpy array, this should be a list of column indices
preprocessing : bool or BaseEstimator/Pipeline,
Expand Down Expand Up @@ -236,7 +236,7 @@ def __init__(self,
Maximum time to evaluate a single individual. If none or inf, there will be no time limit per evaluation.
validation_strategy : str, default='none'
EXPERIMENTAL The validation strategy to use for selecting the final pipeline from the population. TPOT2 may overfit the cross validation score. A second validation set can be used to select the final pipeline.
EXPERIMENTAL The validation strategy to use for selecting the final pipeline from the population. TPOT may overfit the cross validation score. A second validation set can be used to select the final pipeline.
- 'auto' : Automatically determine the validation strategy based on the dataset shape.
- 'reshuffled' : Use the same data for cross validation and final validation, but with different splits for the folds. This is the default for small datasets.
- 'split' : Use a separate validation set for final validation. Data will be split according to validation_fraction. This is the default for medium datasets.
Expand All @@ -246,7 +246,7 @@ def __init__(self,
EXPERIMENTAL The fraction of the dataset to use for the validation set when validation_strategy is 'split'. Must be between 0 and 1.
disable_label_encoder : bool, default=False
If True, TPOT will check if the target needs to be relabeled to be sequential ints from 0 to N. This is necessary for XGBoost compatibility. If the labels need to be encoded, TPOT2 will use sklearn.preprocessing.LabelEncoder to encode the labels. The encoder can be accessed via the self.label_encoder_ attribute.
If True, TPOT will check if the target needs to be relabeled to be sequential ints from 0 to N. This is necessary for XGBoost compatibility. If the labels need to be encoded, TPOT will use sklearn.preprocessing.LabelEncoder to encode the labels. The encoder can be accessed via the self.label_encoder_ attribute.
If False, no additional label encoders will be used.
early_stop : int, default=None
Expand Down Expand Up @@ -340,7 +340,7 @@ def __init__(self,
Folder to save the population to periodically. If None, no periodic saving will be done.
If provided, training will resume from this checkpoint.
callback : tpot2.CallBackInterface, default=None
callback : tpot.CallBackInterface, default=None
Callback object. Not implemented
verbose : int, default=1
Expand Down
8 changes: 4 additions & 4 deletions tpot2/tpot_estimator/estimator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def convert_parents_tuples_to_integers(row, object_to_int):
#TODO add kwargs
def apply_make_pipeline(ind, preprocessing_pipeline=None, export_graphpipeline=False, **pipeline_kwargs):
"""
Helper function to create a column of sklearn pipelines from the tpot2 individual class.
Helper function to create a column of sklearn pipelines from the tpot individual class.
Parameters
----------
ind: tpot2.SklearnIndividual
ind: tpot.SklearnIndividual
The individual to convert to a pipeline.
preprocessing_pipeline: sklearn.pipeline.Pipeline, optional
The preprocessing pipeline to include before the individual's pipeline.
Expand Down Expand Up @@ -109,7 +109,7 @@ def objective_function_generator(pipeline, x,y, scorers, cv, other_objective_fun
Parameters
----------
pipeline: tpot2.SklearnIndividual
pipeline: tpot.SklearnIndividual
The individual to evaluate.
x: np.ndarray
The feature matrix.
Expand Down Expand Up @@ -179,7 +179,7 @@ def val_objective_function_generator(pipeline, X_train, y_train, X_test, y_test,
Parameters
----------
pipeline: tpot2.SklearnIndividual
pipeline: tpot.SklearnIndividual
The individual to evaluate.
X_train: np.ndarray
The feature matrix of the training set.
Expand Down
10 changes: 5 additions & 5 deletions tpot2/tpot_estimator/steady_state_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def __init__(self,
scorers_weights = [],
classification = False,
cv = 10,
other_objective_functions=[], #tpot2.objectives.estimator_objective_functions.number_of_nodes_objective],
other_objective_functions=[], #tpot.objectives.estimator_objective_functions.number_of_nodes_objective],
other_objective_functions_weights = [],
objective_function_names = None,
bigger_is_better = True,
Expand Down Expand Up @@ -227,7 +227,7 @@ def __init__(self,
categorical_features: list or None
Categorical columns to inpute and/or one hot encode during the preprocessing step. Used only if preprocessing is not False.
- None : If None, TPOT2 will automatically use object columns in pandas dataframes as objects for one hot encoding in preprocessing.
- None : If None, TPOT will automatically use object columns in pandas dataframes as objects for one hot encoding in preprocessing.
- List of categorical features. If X is a dataframe, this should be a list of column names. If X is a numpy array, this should be a list of column indices
Expand All @@ -254,7 +254,7 @@ def __init__(self,
- Pipeline : If an instance of a pipeline is given, will use that pipeline as the preprocessing pipeline.
validation_strategy : str, default='none'
EXPERIMENTAL The validation strategy to use for selecting the final pipeline from the population. TPOT2 may overfit the cross validation score. A second validation set can be used to select the final pipeline.
EXPERIMENTAL The validation strategy to use for selecting the final pipeline from the population. TPOT may overfit the cross validation score. A second validation set can be used to select the final pipeline.
- 'auto' : Automatically determine the validation strategy based on the dataset shape.
- 'reshuffled' : Use the same data for cross validation and final validation, but with different splits for the folds. This is the default for small datasets.
- 'split' : Use a separate validation set for final validation. Data will be split according to validation_fraction. This is the default for medium datasets.
Expand All @@ -264,7 +264,7 @@ def __init__(self,
EXPERIMENTAL The fraction of the dataset to use for the validation set when validation_strategy is 'split'. Must be between 0 and 1.
disable_label_encoder : bool, default=False
If True, TPOT will check if the target needs to be relabeled to be sequential ints from 0 to N. This is necessary for XGBoost compatibility. If the labels need to be encoded, TPOT2 will use sklearn.preprocessing.LabelEncoder to encode the labels. The encoder can be accessed via the self.label_encoder_ attribute.
If True, TPOT will check if the target needs to be relabeled to be sequential ints from 0 to N. This is necessary for XGBoost compatibility. If the labels need to be encoded, TPOT will use sklearn.preprocessing.LabelEncoder to encode the labels. The encoder can be accessed via the self.label_encoder_ attribute.
If False, no additional label encoders will be used.
population_size : int, default=50
Expand Down Expand Up @@ -404,7 +404,7 @@ def __init__(self,
Folder to save the population to periodically. If None, no periodic saving will be done.
If provided, training will resume from this checkpoint.
callback : tpot2.CallBackInterface, default=None
callback : tpot.CallBackInterface, default=None
Callback object. Not implemented
processes : bool, default=True
Expand Down
Loading

0 comments on commit 42d378c

Please sign in to comment.