Skip to content

Commit

Permalink
Merge pull request #26 from perib/dev
Browse files Browse the repository at this point in the history
edit api
  • Loading branch information
perib committed Jul 5, 2023
2 parents 8868afe + 4e51f8a commit 38857fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tpot2/evolvers/steady_state_evolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__( self,
memory_limit="4GB",
client=None,

survival_percentage = 1,

crossover_probability=.2,
mutate_probability=.7,
mutate_then_crossover_probability=.05,
Expand Down Expand Up @@ -113,7 +113,7 @@ def __init__( self,

self.survival_selector=survival_selector
self.parent_selector=parent_selector
self.survival_percentage = survival_percentage


total_var_p = crossover_probability + mutate_probability + mutate_then_crossover_probability + crossover_then_mutate_probability
self.crossover_probability = crossover_probability / total_var_p
Expand Down
14 changes: 5 additions & 9 deletions tpot2/tpot_estimator/steady_state_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, scorers= [],
n_jobs=1,
memory_limit = "4GB",
client = None,
survival_percentage = 1,

crossover_probability=.2,
mutate_probability=.7,
mutate_then_crossover_probability=.05,
Expand Down Expand Up @@ -287,11 +287,7 @@ def __init__(self, scorers= [],
client : dask.distributed.Client, default=None
A dask client to use for parallelization. If not None, this will override the n_jobs and memory_limit parameters. If None, will create a new client with num_workers=n_jobs and memory_limit=memory_limit.
survival_percentage : float, default=1
Percentage of the population size to utilize for mutation and crossover at the beginning of the generation. The rest are discarded. Individuals are selected with the selector passed into survival_selector. The value of this parameter must be between 0 and 1, inclusive.
For example, if the population size is 100 and the survival percentage is .5, 50 individuals will be selected with NSGA2 from the existing population. These will be used for mutation and crossover to generate the next 100 individuals for the next generation. The remainder are discarded from the live population. In the next generation, there will now be the 50 parents + the 100 individuals for a total of 150. Surivival percentage is based of the population size parameter and not the existing population size. Therefore, in the next generation we will still select 50 individuals from the currently existing 150.
crossover_probability : float, default=.2
Probability of generating a new individual by crossover between two individuals.
Expand All @@ -309,7 +305,7 @@ def __init__(self, scorers= [],
survival_selector : function, default=survival_select_NSGA2
Function to use to select individuals for survival. Must take a matrix of scores and return selected indexes.
Used to selected population_size * survival_percentage individuals at the start of each generation to use for mutation and crossover.
Used to selected population_size individuals at the start of each generation to use for mutation and crossover.
parent_selector : function, default=parent_select_NSGA2
Function to use to select pairs parents for crossover and individuals for mutation. Must take a matrix of scores and return selected indexes.
Expand Down Expand Up @@ -447,7 +443,7 @@ def __init__(self, scorers= [],
self.n_jobs= n_jobs
self.memory_limit = memory_limit
self.client = client
self.survival_percentage = survival_percentage

self.crossover_probability = crossover_probability
self.mutate_probability = mutate_probability
self.mutate_then_crossover_probability= mutate_then_crossover_probability
Expand Down Expand Up @@ -719,7 +715,7 @@ def objective_function(pipeline_individual,
objective_kwargs = {"X": X_future, "y": y_future},
survival_selector=self.survival_selector,
parent_selector=self.parent_selector,
survival_percentage = self.survival_percentage,

crossover_probability = self.crossover_probability,
mutate_probability = self.mutate_probability,
mutate_then_crossover_probability= self.mutate_then_crossover_probability,
Expand Down

0 comments on commit 38857fe

Please sign in to comment.