Skip to content

Commit

Permalink
Merge pull request #115 from EpistasisLab/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
perib authored Dec 21, 2023
2 parents cb3de5a + 0ad8562 commit 6c3a0f2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
2 changes: 1 addition & 1 deletion tpot2/tpot_estimator/estimator_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down

0 comments on commit 6c3a0f2

Please sign in to comment.