Spaces:
Sleeping
Sleeping
GMARTINEZMILLA
commited on
Commit
•
f643712
1
Parent(s):
f4c152d
feat: updated website
Browse files
app.py
CHANGED
@@ -199,31 +199,22 @@ if page == "Summary":
|
|
199 |
with col2:
|
200 |
st.markdown('#### 3D Customer Clusters')
|
201 |
|
202 |
-
#
|
203 |
-
|
204 |
-
|
205 |
-
'
|
206 |
-
'
|
207 |
-
'
|
208 |
-
'
|
209 |
-
|
210 |
-
|
211 |
-
fig_cluster.update_layout(
|
212 |
-
scene=dict(aspectratio=dict(x=1, y=1, z=0.7)), # Control the aspect ratio
|
213 |
-
margin=dict(t=0, b=0, l=0, r=0), # Tighten margins
|
214 |
-
height=300, # Shrink the height to fit page better
|
215 |
)
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
'Sales': [400000, 600000, 500000, 300000]}
|
223 |
-
df_sales = pd.DataFrame(sales_data)
|
224 |
-
fig_sales = px.bar(df_sales, x='Cluster', y='Sales')
|
225 |
-
fig_sales.update_layout(paper_bgcolor=plot_bgcolor, plot_bgcolor=plot_bgcolor)
|
226 |
-
st.plotly_chart(fig_sales, use_container_width=True)
|
227 |
|
228 |
# Right Column (Blue): Key Metrics Overview and Data Preparation Summary
|
229 |
with col3:
|
|
|
199 |
with col2:
|
200 |
st.markdown('#### 3D Customer Clusters')
|
201 |
|
202 |
+
# Create 3D PCA plot using actual data from pca_data_5
|
203 |
+
fig_cluster = px.scatter_3d(
|
204 |
+
pca_data_5,
|
205 |
+
x='PC1',
|
206 |
+
y='PC2',
|
207 |
+
z='PC3',
|
208 |
+
color='cluster_id',
|
209 |
+
hover_name='CustomerID',
|
210 |
+
title='3D PCA Customer Clusters'
|
|
|
|
|
|
|
|
|
211 |
)
|
212 |
+
fig_cluster.update_layout(
|
213 |
+
scene=dict(aspectratio=dict(x=1, y=1, z=0.7)), # Control the aspect ratio
|
214 |
+
margin=dict(t=0, b=0, l=0, r=0), # Tighten margins
|
215 |
+
height=300, # Shrink the height to fit page better
|
216 |
+
)
|
217 |
+
st.plotly_chart(fig_cluster, use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
218 |
|
219 |
# Right Column (Blue): Key Metrics Overview and Data Preparation Summary
|
220 |
with col3:
|