Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -130,6 +130,7 @@ clusters_jsons = None
|
|
130 |
|
131 |
|
132 |
def run_clustering(num_clusters, clusters_to_display):
|
|
|
133 |
kmeans = KMeans(n_clusters=num_clusters, random_state=42)
|
134 |
restaurant_clusters = cluster_embeddings(restaurant_embeddings, kmeans)
|
135 |
df['cluster'] = df['res_cell_id'].map(restaurant_clusters)
|
@@ -161,7 +162,7 @@ def run_clustering(num_clusters, clusters_to_display):
|
|
161 |
return analysis, m
|
162 |
|
163 |
def update_display(clusters_to_display):
|
164 |
-
|
165 |
if clusters_jsons is None:
|
166 |
return Map(location=[12.935656, 77.543204], zoom_start=12)
|
167 |
|
|
|
130 |
|
131 |
|
132 |
def run_clustering(num_clusters, clusters_to_display):
|
133 |
+
global clusters_jsons
|
134 |
kmeans = KMeans(n_clusters=num_clusters, random_state=42)
|
135 |
restaurant_clusters = cluster_embeddings(restaurant_embeddings, kmeans)
|
136 |
df['cluster'] = df['res_cell_id'].map(restaurant_clusters)
|
|
|
162 |
return analysis, m
|
163 |
|
164 |
def update_display(clusters_to_display):
|
165 |
+
global clusters_jsons
|
166 |
if clusters_jsons is None:
|
167 |
return Map(location=[12.935656, 77.543204], zoom_start=12)
|
168 |
|