8000 Increase execution speed of plot_cluster_comparison.py by Iglesys347 · Pull Request #21624 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

Increase execution speed of plot_cluster_comparison.py #21624

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

Merged
merged 7 commits into from
Mar 10, 2022
29 changes: 19 additions & 10 deletions examples/cluster/plot_cluster_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
# Generate datasets. We choose the size big enough to see the scalability
# of the algorithms, but not too big to avoid too long running times
# ============
n_samples = 1500
n_samples = 500
noisy_circles = datasets.make_circles(n_samples=n_samples, factor=0.5, noise=0.05)
noisy_moons = datasets.make_moons(n_samples=n_samples, noise=0.05)
blobs = datasets.make_blobs(n_samples=n_samples, random_state=8)
Expand Down Expand Up @@ -74,9 +74,9 @@
"eps": 0.3,
"damping": 0.9,
"preference": -200,
"n_neighbors": 10,
"n_neighbors": 3,
"n_clusters": 3,
"min_samples": 20,
"min_samples": 7,
"xi": 0.05,
"min_cluster_size": 0.1,
}
Expand All @@ -89,18 +89,27 @@
"preference": -240,
"quantile": 0.2,
"n_clusters": 2,
"min_samples": 20,
"xi": 0.25,
"min_samples": 7,
"xi": 0.08,
},
),
(
noisy_moons,
{
"damping": 0.75,
"preference": -220,
"n_clusters": 2,
"min_samples": 7,
"xi": 0.1,
},
),
(noisy_moons, {"damping": 0.75, "preference": -220, "n_clusters": 2}),
(
varied,
{
"eps": 0.18,
"n_neighbors": 2,
"min_samples": 5,
"xi": 0.035,
"min_samples": 7,
"xi": 0.01,
"min_cluster_size": 0.2,
},
),
Expand All @@ -109,12 +118,12 @@
{
"eps": 0.15,
"n_neighbors": 2,
"min_samples": 20,
"min_samples": 7,
"xi": 0.1,
"min_cluster_size": 0.2,
},
),
(blobs, {}),
(blobs, {"min_samples": 7, "xi": 0.1, "min_cluster_size": 0.2}),
(no_structure, {}),
]

Expand Down
0