-
Notifications
You must be signed in to change notification settings - Fork 10
Sourcery Starbot ⭐ refactored bm424/scikit-cmeans #2
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
base: master
Are you sure you want to change the base?
Conversation
centers_best = None | ||
iterator = range(self.n_init) | ||
for i in iterator: | ||
for _ in iterator: |
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.
Function CMeans.fit
refactored with the following changes:
- Replace unused for index with underscore (
for-index-underscore
)
if np.abs(j_old - j_new) < self.tol: | ||
break | ||
results = { | ||
return { |
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.
Function CMeans.converge
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
raise NotImplementedError("Method '{}' is not implemented.".format(method)) | ||
raise NotImplementedError(f"Method '{method}' is not implemented.") |
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.
Function CMeans.plot
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
color = plt.cm.tab20(np.linspace(0, 1, algorithm.n_clusters)) | ||
for j, c in zip(range(algorithm.n_clusters), color): | ||
print("Plotting cluster {} ({})".format(j, c)) | ||
print(f"Plotting cluster {j} ({c})") |
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.
Function contour
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
legend_handles = [] | ||
for j, c in zip(range(algorithm.n_clusters), color): | ||
print("Plotting cluster {} ({})".format(j, c)) | ||
print(f"Plotting cluster {j} ({c})") |
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.
Function scatter
refactored with the following changes:
- Replace call to format with f-string (
use-fstring-for-formatting
)
values_list = itertools.product(*param_data.values()) | ||
params = [dict(zip(param_data.keys(), v)) for v in values_list] | ||
return params | ||
return [dict(zip(param_data.keys(), v)) for v in values_list] |
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.
Function combine_param_data
refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable
)
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: