Spaces:
Sleeping
Sleeping
Commit
·
4f07877
1
Parent(s):
43107a1
feat: updated website
Browse files
app.py
CHANGED
@@ -273,7 +273,6 @@ elif page == "Customer Analysis":
|
|
273 |
# Load the Corresponding Model
|
274 |
model_path = f'models/modelo_cluster_{cluster}.txt'
|
275 |
gbm = lgb.Booster(model_file=model_path)
|
276 |
-
time.sleep(1)
|
277 |
|
278 |
with st.spinner("Getting the data ready..."):
|
279 |
# Load predict data for that cluster
|
@@ -281,14 +280,12 @@ elif page == "Customer Analysis":
|
|
281 |
|
282 |
# Convert cliente_id to string
|
283 |
predict_data['cliente_id'] = predict_data['cliente_id'].astype(str)
|
284 |
-
time.sleep(1)
|
285 |
|
286 |
with st.spinner("Filtering data..."):
|
287 |
|
288 |
# Filter for the specific customer
|
289 |
customer_code_str = str(customer_code)
|
290 |
customer_data = predict_data[predict_data['cliente_id'] == customer_code_str]
|
291 |
-
time.sleep(1)
|
292 |
|
293 |
with st.spinner("Generating sales predictions..."):
|
294 |
|
@@ -408,7 +405,7 @@ elif page == "Customer Analysis":
|
|
408 |
|
409 |
# st.write(f"### Results for top {len(manufacturers)} manufacturers:")
|
410 |
for manufacturer, value, amount in zip(manufacturers, values, amounts):
|
411 |
-
|
412 |
|
413 |
if manufacturers: # Only create the chart if we have data
|
414 |
fig = radar_chart(manufacturers, values, amounts, f'Radar Chart for Top {len(manufacturers)} Manufacturers of Customer {customer_code}')
|
|
|
273 |
# Load the Corresponding Model
|
274 |
model_path = f'models/modelo_cluster_{cluster}.txt'
|
275 |
gbm = lgb.Booster(model_file=model_path)
|
|
|
276 |
|
277 |
with st.spinner("Getting the data ready..."):
|
278 |
# Load predict data for that cluster
|
|
|
280 |
|
281 |
# Convert cliente_id to string
|
282 |
predict_data['cliente_id'] = predict_data['cliente_id'].astype(str)
|
|
|
283 |
|
284 |
with st.spinner("Filtering data..."):
|
285 |
|
286 |
# Filter for the specific customer
|
287 |
customer_code_str = str(customer_code)
|
288 |
customer_data = predict_data[predict_data['cliente_id'] == customer_code_str]
|
|
|
289 |
|
290 |
with st.spinner("Generating sales predictions..."):
|
291 |
|
|
|
405 |
|
406 |
# st.write(f"### Results for top {len(manufacturers)} manufacturers:")
|
407 |
for manufacturer, value, amount in zip(manufacturers, values, amounts):
|
408 |
+
(f"{manufacturer} = {value:.2f}% of units, €{amount:.2f} total sales")
|
409 |
|
410 |
if manufacturers: # Only create the chart if we have data
|
411 |
fig = radar_chart(manufacturers, values, amounts, f'Radar Chart for Top {len(manufacturers)} Manufacturers of Customer {customer_code}')
|