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]) 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.")