Spaces:
Sleeping
Sleeping
GMARTINEZMILLA
commited on
Commit
•
290ed5a
1
Parent(s):
d1ec67b
feat: Updated colours in 3D cluster
Browse files
app.py
CHANGED
@@ -227,9 +227,8 @@ if page == "📃 Resumen":
|
|
227 |
# Middle Column (White): 3D Cluster Model and Bar Chart
|
228 |
with col2:
|
229 |
st.markdown('#### Cluster de Clientes 3D')
|
230 |
-
pca_data_5['cluster_id'] = pca_data_5['cluster_id'].astype(str)
|
231 |
|
232 |
-
# Create 3D PCA plot using actual data from pca_data_5
|
233 |
fig_cluster = px.scatter_3d(
|
234 |
pca_data_5,
|
235 |
x='PC1',
|
@@ -237,13 +236,7 @@ if page == "📃 Resumen":
|
|
237 |
z='PC3',
|
238 |
color='cluster_id',
|
239 |
hover_name='CustomerID',
|
240 |
-
|
241 |
-
'0': '#FFD700', # Deeper yellow for cluster 0
|
242 |
-
'1': '#FFA500', # Orange for cluster 1
|
243 |
-
'2': '#FF6347', # Tomato for cluster 2
|
244 |
-
'3': '#FF4500', # OrangeRed for cluster 3
|
245 |
-
'4': '#FF0000' # Red for cluster 4
|
246 |
-
},
|
247 |
)
|
248 |
fig_cluster.update_layout(
|
249 |
scene=dict(aspectratio=dict(x=1, y=1, z=0.8)), # Adjusted aspect ratio for better balance
|
|
|
227 |
# Middle Column (White): 3D Cluster Model and Bar Chart
|
228 |
with col2:
|
229 |
st.markdown('#### Cluster de Clientes 3D')
|
|
|
230 |
|
231 |
+
# Create 3D PCA plot using actual data from pca_data_5
|
232 |
fig_cluster = px.scatter_3d(
|
233 |
pca_data_5,
|
234 |
x='PC1',
|
|
|
236 |
z='PC3',
|
237 |
color='cluster_id',
|
238 |
hover_name='CustomerID',
|
239 |
+
color_continuous_scale='YlGnBu'
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
)
|
241 |
fig_cluster.update_layout(
|
242 |
scene=dict(aspectratio=dict(x=1, y=1, z=0.8)), # Adjusted aspect ratio for better balance
|