minor improve in clustering
Browse files- apps/clustering.py +4 -4
apps/clustering.py
CHANGED
|
@@ -171,8 +171,8 @@ if uploaded_file:
|
|
| 171 |
cluster_method = st.selectbox(
|
| 172 |
"Select clustering method",
|
| 173 |
[
|
| 174 |
-
"
|
| 175 |
-
"
|
| 176 |
],
|
| 177 |
)
|
| 178 |
mix_regions = st.checkbox(
|
|
@@ -181,11 +181,11 @@ if uploaded_file:
|
|
| 181 |
submitted = st.form_submit_button("Run Clustering")
|
| 182 |
|
| 183 |
if submitted:
|
| 184 |
-
if cluster_method == "
|
| 185 |
clustered_df = cluster_sites_hilbert_curve_same_size(
|
| 186 |
df, lat_col, lon_col, region_col, max_sites, mix_regions
|
| 187 |
)
|
| 188 |
-
elif cluster_method == "
|
| 189 |
clustered_df = cluster_sites_kmeans_lower_to_fixed_size(
|
| 190 |
df, lat_col, lon_col, region_col, max_sites, mix_regions
|
| 191 |
)
|
|
|
|
| 171 |
cluster_method = st.selectbox(
|
| 172 |
"Select clustering method",
|
| 173 |
[
|
| 174 |
+
"Uniform number of sites for each cluster", # Hilbert Curve
|
| 175 |
+
"Number of sites Lower than max but not uniform", # KMeans
|
| 176 |
],
|
| 177 |
)
|
| 178 |
mix_regions = st.checkbox(
|
|
|
|
| 181 |
submitted = st.form_submit_button("Run Clustering")
|
| 182 |
|
| 183 |
if submitted:
|
| 184 |
+
if cluster_method == "Uniform number of sites for each cluster":
|
| 185 |
clustered_df = cluster_sites_hilbert_curve_same_size(
|
| 186 |
df, lat_col, lon_col, region_col, max_sites, mix_regions
|
| 187 |
)
|
| 188 |
+
elif cluster_method == "Number of sites Lower than max but not uniform":
|
| 189 |
clustered_df = cluster_sites_kmeans_lower_to_fixed_size(
|
| 190 |
df, lat_col, lon_col, region_col, max_sites, mix_regions
|
| 191 |
)
|