JUNGU commited on
Commit
0b844d2
Β·
1 Parent(s): 8eeb6e7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -7
app.py CHANGED
@@ -27,13 +27,15 @@ def apply_kmeans(data, k):
27
 
28
  def generate_data():
29
  global traffic_df, nature_df, population_df
30
- traffic_data = [np.random.normal(center, 10, (num_samples, 2)) for center in traffic_centers]
31
- nature_data = [np.random.normal(center, 10, (num_samples, 2)) for center in nature_centers]
32
- population_data = [np.random.normal(center, 10, (num_samples, 2)) for center in population_centers]
 
 
33
 
34
- traffic_df = pd.DataFrame(np.vstack(traffic_data), columns=["x", "y"])
35
- nature_df = pd.DataFrame(np.vstack(nature_data), columns=["x", "y"])
36
- population_df = pd.DataFrame(np.vstack(population_data), columns=["x", "y"])
37
 
38
  def main():
39
  st.title("K-means Clustering Simulator")
@@ -49,7 +51,7 @@ def main():
49
  "인ꡬ밀집도": population_df
50
  }
51
 
52
- # Check if any dataset is selected
53
  if datasets:
54
  combined_data = pd.concat([dataset_mapping[dataset_name] for dataset_name in datasets])
55
 
 
27
 
28
  def generate_data():
29
  global traffic_df, nature_df, population_df
30
+
31
+ # λžœλ€λ°μ΄ν„° 생성
32
+ traffic_data = np.random.uniform(0, 100, (num_samples, 2))
33
+ nature_data = np.random.uniform(0, 100, (num_samples, 2))
34
+ population_data = np.random.uniform(0, 100, (num_samples, 2))
35
 
36
+ traffic_df = pd.DataFrame(traffic_data, columns=["x", "y"])
37
+ nature_df = pd.DataFrame(nature_data, columns=["x", "y"])
38
+ population_df = pd.DataFrame(population_data, columns=["x", "y"])
39
 
40
  def main():
41
  st.title("K-means Clustering Simulator")
 
51
  "인ꡬ밀집도": population_df
52
  }
53
 
54
+ # 아무 값도 μ—†μ„λ•Œ
55
  if datasets:
56
  combined_data = pd.concat([dataset_mapping[dataset_name] for dataset_name in datasets])
57