ankush-003 commited on
Commit
c0a6c3c
·
verified ·
1 Parent(s): 8780754

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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