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

Add plotting of calkmeans results #37

Open
robmarkcole opened this issue Oct 18, 2024 · 2 comments
Open

Add plotting of calkmeans results #37

robmarkcole opened this issue Oct 18, 2024 · 2 comments

Comments

@robmarkcole
Copy link
Contributor

Description

Would help users to review results. Not sure where best to put these utility plot functions? Alternatively add to an example notebook/documentation

Source code

# Plot inertia vs. number of clusters to find the "elbow point"
results = calkmeans(img, k=None, algo=('lloyd', 'elkan'), n_iter=10)

cluster_range = range(1, 11)
plt.figure(figsize=(8, 6))
for algorithm in results:
    plt.plot(cluster_range, results[algorithm], marker='o', label=f'Algorithm: {algorithm}')
plt.title('Inertia vs Number of Clusters')
plt.xlabel('Number of Clusters')
plt.ylabel('Inertia')
plt.legend()
plt.show()

Output example:
image

@yotarazona
Copy link
Owner

yotarazona commented Oct 21, 2024

Hi @robmarkcole, thank you again for your contribution to improve scikit-eo. This implementation can take some time considering that I am writing an article related to my PhD. In case you decide to contribute, I will be grateful.
This function could be inside process.py or inside calkmeans.py, maybe.

@yotarazona
Copy link
Owner

or maybe inside plot.py, could be.

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

No branches or pull requests

2 participants