Kiuyha commited on
Commit
a509f46
·
verified ·
1 Parent(s): 63f1c14

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -209,7 +209,8 @@ base_input = {
209
  'is_power_merchant': 1 if shop_tier == "Power Merchant" else 0,
210
  'is_official_store': 1 if shop_tier == "Official Store" else 0,
211
 
212
- 'video_count': vid_count, 'image_count': img_count,
 
213
 
214
  'can_shipping_instant': 1 if ship_inst else 0,
215
  'can_shipping_sameday': 1 if ship_same else 0,
@@ -260,11 +261,8 @@ st.divider()
260
  st.subheader("💰 Price Prediction")
261
 
262
  if price_models:
263
- col_model, col_btn = st.columns([1, 1])
264
- with col_model:
265
- model_name = st.selectbox("Select Model", list(price_models.keys()), label_visibility="collapsed")
266
- with col_btn:
267
- predict_btn = st.button("Predict Price", type="primary", use_container_width=True)
268
 
269
  if predict_btn:
270
  raw_df = prepare_raw_dataframe(base_input, price_cols, vectorizer)
@@ -280,7 +278,7 @@ if price_models:
280
 
281
  st.success(f"Estimated Price: **Rp {price_pred:,.0f}**")
282
 
283
- with st.expander("Feature Importance Analysis"):
284
- load_and_plot_importance(model_name, "price")
285
  else:
286
  st.error("Models failed to load.")
 
209
  'is_power_merchant': 1 if shop_tier == "Power Merchant" else 0,
210
  'is_official_store': 1 if shop_tier == "Official Store" else 0,
211
 
212
+ 'video_count': vid_count,
213
+ 'image_count': img_count,
214
 
215
  'can_shipping_instant': 1 if ship_inst else 0,
216
  'can_shipping_sameday': 1 if ship_same else 0,
 
261
  st.subheader("💰 Price Prediction")
262
 
263
  if price_models:
264
+ model_name = st.selectbox("Select Model", list(price_models.keys()), label_visibility="collapsed")
265
+ predict_btn = st.button("Predict Price", type="primary", use_container_width=True)
 
 
 
266
 
267
  if predict_btn:
268
  raw_df = prepare_raw_dataframe(base_input, price_cols, vectorizer)
 
278
 
279
  st.success(f"Estimated Price: **Rp {price_pred:,.0f}**")
280
 
281
+ with st.expander("Feature Importance Analysis"):
282
+ load_and_plot_importance(model_name, "price")
283
  else:
284
  st.error("Models failed to load.")