From a904acf8b58b5eea08e29a51b424775a388a6519 Mon Sep 17 00:00:00 2001 From: perib Date: Tue, 28 Nov 2023 09:30:29 -0800 Subject: [PATCH 1/2] fixed recursive search space probabilities --- .../graph_pipeline_individual/individual.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tpot2/individual_representations/graph_pipeline_individual/individual.py b/tpot2/individual_representations/graph_pipeline_individual/individual.py index bc2a883a..f890e80f 100644 --- a/tpot2/individual_representations/graph_pipeline_individual/individual.py +++ b/tpot2/individual_representations/graph_pipeline_individual/individual.py @@ -1193,7 +1193,10 @@ def random_weighted_sort(l,weights, rng_=None): sorted_l = [] indeces = {i: weights[i] for i in range(len(l))} while len(indeces) > 0: - next_item = rng.choice(list(indeces.keys()), p=list(indeces.values())) + keys = list(indeces.keys()) + p = np.array([indeces[k] for k in keys]) + p = p / p.sum() + next_item = rng.choice(list(indeces.keys()), p=p) indeces.pop(next_item) sorted_l.append(l[next_item]) From a662f3976d7a05fe7a57a3ac5c82ae88d2ba5821 Mon Sep 17 00:00:00 2001 From: perib Date: Thu, 14 Dec 2023 09:39:54 -0800 Subject: [PATCH 2/2] fixed config dict typo --- tpot2/tpot_estimator/estimator_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpot2/tpot_estimator/estimator_utils.py b/tpot2/tpot_estimator/estimator_utils.py index 07fe65ac..47f31450 100644 --- a/tpot2/tpot_estimator/estimator_utils.py +++ b/tpot2/tpot_estimator/estimator_utils.py @@ -79,7 +79,7 @@ def get_configuration_dictionary(options, n_samples, n_features, classification, else: - config_dict.update(recursive_with_defaults(options, n_samples, n_features, classification, random_state, cv, subsets=subsets, feature_names=feature_names, n_classes=n_classes)) + config_dict.update(recursive_with_defaults(option, n_samples, n_features, classification, random_state, cv, subsets=subsets, feature_names=feature_names, n_classes=n_classes)) if len(config_dict) == 0: raise ValueError("No valid configuration options were provided. Please check the options you provided and try again.")