Commit
·
c79b7a6
1
Parent(s):
2df0d19
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,16 @@ theme = gr.themes.Monochrome(
|
|
17 |
|
18 |
description = f"""
|
19 |
## Description
|
20 |
-
This demo can be used to evaluate the ability of k-means initializations strategies to make the algorithm convergence robust
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
"""
|
22 |
|
23 |
# k-means models can do several random inits so as to be able to trade
|
@@ -116,6 +125,8 @@ with gr.Blocks(theme=theme) as demo:
|
|
116 |
with gr.Row():
|
117 |
n_runs = gr.Slider(minimum=1, maximum=10, step=1, value=5, label="Number of Evaluation Runs")
|
118 |
random_state = gr.Slider(minimum=0, maximum=2000, step=5, value=0, label="Random state")
|
|
|
|
|
119 |
n_samples_per_center = gr.Slider(minimum=50, maximum=200, step=10, value=100, label="Number of Samples per Center")
|
120 |
grid_size = gr.Slider(minimum=1, maximum=8, step=1, value=3, label="Grid Size")
|
121 |
|
|
|
17 |
|
18 |
description = f"""
|
19 |
## Description
|
20 |
+
This demo can be used to evaluate the ability of k-means initializations strategies to make the algorithm convergence robust as measured by the
|
21 |
+
relative standard deviation of the inertia of the clustering (i.e. the sum of squared distances to the nearest cluster center).
|
22 |
+
|
23 |
+
The dataset used for evaluation is a 2D grid of isotropic Gaussian clusters widely spaced.
|
24 |
+
|
25 |
+
The Inertia plot shows the best inertia reached for each combination of the model (KMeans or MiniBatchKMeans), and either random initialization or k-means++ initialization.
|
26 |
+
|
27 |
+
The Cluster Allocation plot demonstrates one single run of the MiniBatchKMeans estimator using a single random initialization.
|
28 |
+
|
29 |
+
The demo is based on the [scikit-learn docs](https://scikit-learn.org/stable/auto_examples/cluster/plot_kmeans_stability_low_dim_dense.html#sphx-glr-auto-examples-cluster-plot-kmeans-stability-low-dim-dense-py)
|
30 |
"""
|
31 |
|
32 |
# k-means models can do several random inits so as to be able to trade
|
|
|
125 |
with gr.Row():
|
126 |
n_runs = gr.Slider(minimum=1, maximum=10, step=1, value=5, label="Number of Evaluation Runs")
|
127 |
random_state = gr.Slider(minimum=0, maximum=2000, step=5, value=0, label="Random state")
|
128 |
+
|
129 |
+
with gr.Row():
|
130 |
n_samples_per_center = gr.Slider(minimum=50, maximum=200, step=10, value=100, label="Number of Samples per Center")
|
131 |
grid_size = gr.Slider(minimum=1, maximum=8, step=1, value=3, label="Grid Size")
|
132 |
|