Skip to content

Conversation

SourceryAI
Copy link

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:

git fetch https://github.com/sourcery-ai-bot/scikit-cmeans master
git merge --ff-only FETCH_HEAD
git reset HEAD^

centers_best = None
iterator = range(self.n_init)
for i in iterator:
for _ in iterator:
Copy link
Author

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:

if np.abs(j_old - j_new) < self.tol:
break
results = {
return {
Copy link
Author

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:

Comment on lines -216 to +215
raise NotImplementedError("Method '{}' is not implemented.".format(method))
raise NotImplementedError(f"Method '{method}' is not implemented.")
Copy link
Author

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:

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})")
Copy link
Author

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:

legend_handles = []
for j, c in zip(range(algorithm.n_clusters), color):
print("Plotting cluster {} ({})".format(j, c))
print(f"Plotting cluster {j} ({c})")
Copy link
Author

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:

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]
Copy link
Author

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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant