Spaces:
Sleeping
Sleeping
changed df name, n_digits info
Browse files
app.py
CHANGED
|
@@ -160,10 +160,14 @@ with gr.Blocks(title=title, theme=theme) as demo:
|
|
| 160 |
gr.Markdown("As the ground truth is known here, we also apply different cluster quality metrics to judge the goodness of fit of the cluster labels to the ground truth.")
|
| 161 |
gr.Markdown("Cluster quality metrics evaluated (see [Clustering performance evaluation](https://scikit-learn.org/stable/modules/clustering.html#clustering-evaluation) \
|
| 162 |
for definitions and discussions of the metrics):")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 163 |
|
| 164 |
with gr.Row():
|
| 165 |
with gr.Column(scale=0.5):
|
| 166 |
-
kmeans_n_digit = gr.Slider(minimum=2, maximum=10, label="KMeans n_digits",
|
| 167 |
random_n_digit = gr.Slider(minimum=2, maximum=10, label="Random n_digits", step=1, value=10)
|
| 168 |
pca_n_digit = gr.Slider(minimum=2, maximum=10, label="PCA n_digits",step=1, value=10)
|
| 169 |
|
|
@@ -172,10 +176,8 @@ with gr.Blocks(title=title, theme=theme) as demo:
|
|
| 172 |
with gr.Column(scale=0.5):
|
| 173 |
sample_df = pd.DataFrame(np.zeros((9,4)),columns=['metrics', 'k-means++', 'random', 'PCA-based'])
|
| 174 |
|
| 175 |
-
output = gr.Dataframe(sample_df, label="
|
| 176 |
-
|
| 177 |
|
| 178 |
-
|
| 179 |
with gr.Row():
|
| 180 |
sub_btn = gr.Button("Submit")
|
| 181 |
sub_btn.click(fn=do_submit, inputs=[kmeans_n_digit,random_n_digit, pca_n_digit], outputs=[plt_out, output])
|
|
|
|
| 160 |
gr.Markdown("As the ground truth is known here, we also apply different cluster quality metrics to judge the goodness of fit of the cluster labels to the ground truth.")
|
| 161 |
gr.Markdown("Cluster quality metrics evaluated (see [Clustering performance evaluation](https://scikit-learn.org/stable/modules/clustering.html#clustering-evaluation) \
|
| 162 |
for definitions and discussions of the metrics):")
|
| 163 |
+
gr.Markdown("---")
|
| 164 |
+
gr.Markdown(" We will be utilizing [digits](https://huggingface.co/datasets/sklearn-docs/digits) dataset. This dataset contains handwritten digits from 0 to 9. \
|
| 165 |
+
In the context of clustering, one would like to group images such that the handwritten digits on the image are the same.")
|
| 166 |
+
|
| 167 |
|
| 168 |
with gr.Row():
|
| 169 |
with gr.Column(scale=0.5):
|
| 170 |
+
kmeans_n_digit = gr.Slider(minimum=2, maximum=10, label="KMeans n_digits", info="n_digits is number of handwritten digits" , step=1, value=10)
|
| 171 |
random_n_digit = gr.Slider(minimum=2, maximum=10, label="Random n_digits", step=1, value=10)
|
| 172 |
pca_n_digit = gr.Slider(minimum=2, maximum=10, label="PCA n_digits",step=1, value=10)
|
| 173 |
|
|
|
|
| 176 |
with gr.Column(scale=0.5):
|
| 177 |
sample_df = pd.DataFrame(np.zeros((9,4)),columns=['metrics', 'k-means++', 'random', 'PCA-based'])
|
| 178 |
|
| 179 |
+
output = gr.Dataframe(sample_df, label="Clustering Metrics")
|
|
|
|
| 180 |
|
|
|
|
| 181 |
with gr.Row():
|
| 182 |
sub_btn = gr.Button("Submit")
|
| 183 |
sub_btn.click(fn=do_submit, inputs=[kmeans_n_digit,random_n_digit, pca_n_digit], outputs=[plt_out, output])
|