From 11c6cced34a2a11605f77b0113f0caee35e3a867 Mon Sep 17 00:00:00 2001 From: "rodrigo.arenas" <31422766+rodrigo-arenas@users.noreply.github.com> Date: Tue, 17 Sep 2024 08:57:45 -0500 Subject: [PATCH 1/2] add creator --- sklearn_genetic/genetic_search.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sklearn_genetic/genetic_search.py b/sklearn_genetic/genetic_search.py index e90db36..8192762 100644 --- a/sklearn_genetic/genetic_search.py +++ b/sklearn_genetic/genetic_search.py @@ -263,7 +263,7 @@ def __init__( self.pre_dispatch = pre_dispatch self.error_score = error_score self.return_train_score = return_train_score - # self.creator = creator + self.creator = creator self.log_config = log_config self.use_cache = use_cache self.fitness_cache = {} @@ -939,7 +939,7 @@ def __init__( self.pre_dispatch = pre_dispatch self.error_score = error_score self.return_train_score = return_train_score - # self.creator = creator + self.creator = creator self.log_config = log_config self.use_cache = use_cache self.fitness_cache = {} From 87cdbe0cb6cb648546a76bb4cf2d43449f7400ad Mon Sep 17 00:00:00 2001 From: "rodrigo.arenas" <31422766+rodrigo-arenas@users.noreply.github.com> Date: Tue, 17 Sep 2024 11:46:27 -0500 Subject: [PATCH 2/2] creator reference --- docs/release_notes.rst | 10 ++++++++++ sklearn_genetic/_version.py | 2 +- sklearn_genetic/genetic_search.py | 8 ++++---- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/docs/release_notes.rst b/docs/release_notes.rst index 2db6a18..e046e00 100644 --- a/docs/release_notes.rst +++ b/docs/release_notes.rst @@ -3,6 +3,16 @@ Release Notes Some notes on new features in various releases +What's new in 0.11.1 +-------------------- + +^^^^^^^^^^ +Bug Fixes: +^^^^^^^^^^ + +* Fixed a bug that would generate AttributeError: 'GASearchCV' object has no attribute 'creator' + + What's new in 0.11.0 -------------------- diff --git a/sklearn_genetic/_version.py b/sklearn_genetic/_version.py index ae6db5f..fee46bd 100644 --- a/sklearn_genetic/_version.py +++ b/sklearn_genetic/_version.py @@ -1 +1 @@ -__version__ = "0.11.0" +__version__ = "0.11.1" diff --git a/sklearn_genetic/genetic_search.py b/sklearn_genetic/genetic_search.py index 8192762..8decc0e 100644 --- a/sklearn_genetic/genetic_search.py +++ b/sklearn_genetic/genetic_search.py @@ -263,7 +263,7 @@ def __init__( self.pre_dispatch = pre_dispatch self.error_score = error_score self.return_train_score = return_train_score - self.creator = creator + # self.creator = creator self.log_config = log_config self.use_cache = use_cache self.fitness_cache = {} @@ -308,8 +308,8 @@ def _register(self): """ self.toolbox = base.Toolbox() - self.creator.create("FitnessMax", base.Fitness, weights=[self.criteria_sign, 1.0]) - self.creator.create("Individual", list, fitness=creator.FitnessMax) + creator.create("FitnessMax", base.Fitness, weights=[self.criteria_sign, 1.0]) + creator.create("Individual", list, fitness=creator.FitnessMax) attributes = [] @@ -939,7 +939,7 @@ def __init__( self.pre_dispatch = pre_dispatch self.error_score = error_score self.return_train_score = return_train_score - self.creator = creator + # self.creator = creator self.log_config = log_config self.use_cache = use_cache self.fitness_cache = {}