Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #115

Merged
merged 4 commits into from
Dec 21, 2023
Merged

Dev #115

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading