-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
DOC Documents fixed to increase speed by removing for loop #27066
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
Conversation
…f plot remove for loop
remove for loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR @narendrasinghdangi ! I am okay with the proposed change.
@@ -232,7 +232,7 @@ def plot_n_features_influence(percentiles, percentile): | |||
fig, ax1 = plt.subplots(figsize=(10, 6)) | |||
colors = ["r", "g", "b"] | |||
for i, cls_name in enumerate(percentiles.keys()): | |||
x = np.array(sorted([n for n in percentiles[cls_name].keys()])) | |||
x = np.array(sorted(list(percentiles[cls_name].keys()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this case, I do not think the list
is required either:
x = np.array(sorted(list(percentiles[cls_name].keys()))) | |
x = np.array(sorted(percentiles[cls_name].keys())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, you are right i have changed the file now you can merge now to main branch
thank you
Thank you for your suggestion i have changed the file now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reference Issues/PRs
Closes #27065
What does this implement/fix? Explain your changes.
Increase the speed by removing for loop O(n) -> O(1)
Any other comments?