Add details to description and plot
Browse files
app.py
CHANGED
@@ -56,11 +56,25 @@ def create_plot(num_clusters, num_samples):
|
|
56 |
)
|
57 |
|
58 |
plt.title("Estimated number of clusters: %d" % n_clusters_)
|
|
|
|
|
59 |
|
60 |
return fig, metrics_str
|
61 |
|
62 |
title = "Affinity propagation clustering algorithm"
|
63 |
-
description = "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
with gr.Blocks() as demo:
|
65 |
gr.Markdown(f"## {title}")
|
66 |
gr.Markdown(description)
|
|
|
56 |
)
|
57 |
|
58 |
plt.title("Estimated number of clusters: %d" % n_clusters_)
|
59 |
+
plt.xlabel("x")
|
60 |
+
plt.ylabel("y")
|
61 |
|
62 |
return fig, metrics_str
|
63 |
|
64 |
title = "Affinity propagation clustering algorithm"
|
65 |
+
description = """
|
66 |
+
This demo plots clusters of a synthetic 2D dataset that contains up to 4 clusters using the affinity propagation algorithm.\
|
67 |
+
|
68 |
+
|
69 |
+
The 2-dimensional dataset is generated around 2 to 4 predetermined cluster centers, by sampling a Gaussian distribution \
|
70 |
+
with 0.5 standard deviation around each center. The demo uses the affinity propagation clustering algorithm to assign the data into \
|
71 |
+
clusters. It also calculates a cluster center. \
|
72 |
+
|
73 |
+
|
74 |
+
The figure shows a scatter plot of the data points and their connection to the respective cluster center. The demo also \
|
75 |
+
presents several metrics based on the true and assigned labels.
|
76 |
+
|
77 |
+
"""
|
78 |
with gr.Blocks() as demo:
|
79 |
gr.Markdown(f"## {title}")
|
80 |
gr.Markdown(description)
|