singhn9 commited on
Commit
858aa8a
·
verified ·
1 Parent(s): 25cace9

Update src/streamlit_app.py

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +4 -3
src/streamlit_app.py CHANGED
@@ -55,7 +55,7 @@ if "hf_clicked" not in st.session_state:
55
  # Config & paths
56
  # -------------------------
57
  st.set_page_config(page_title="Steel Authority of India Limited (MODEX)", layout="wide")
58
- plt.style.use("seaborn-v0_8-muted")
59
  sns.set_palette("muted")
60
  sns.set_style("whitegrid")
61
 
@@ -458,7 +458,7 @@ with tabs[4]:
458
  return df_clean
459
 
460
  df = clean_entire_df(df)
461
- st.caption(" Dataset cleaned globally — all numeric-like values converted safely.")
462
 
463
  # --- Use Case Selection ---
464
  use_case = st.selectbox(
@@ -564,7 +564,8 @@ with tabs[4]:
564
  study = optuna.create_study(direction="maximize")
565
  study.optimize(obj, n_trials=n_trials, show_progress_bar=False)
566
  params = study.best_trial.params if study.trials else {}
567
- model = RandomForestRegressor(random_state=42)
 
568
  return {"family": fam, "model_obj": model, "best_params": params, "cv_score": study.best_value}
569
 
570
  # --- Run button ---
 
55
  # Config & paths
56
  # -------------------------
57
  st.set_page_config(page_title="Steel Authority of India Limited (MODEX)", layout="wide")
58
+ plt.style.use("seaborn-muted")
59
  sns.set_palette("muted")
60
  sns.set_style("whitegrid")
61
 
 
458
  return df_clean
459
 
460
  df = clean_entire_df(df)
461
+ st.caption(" Dataset cleaned globally — all numeric-like values converted safely.")
462
 
463
  # --- Use Case Selection ---
464
  use_case = st.selectbox(
 
564
  study = optuna.create_study(direction="maximize")
565
  study.optimize(obj, n_trials=n_trials, show_progress_bar=False)
566
  params = study.best_trial.params if study.trials else {}
567
+ if fam == "RandomForest":
568
+ model = RandomForestRegressor(**study.best_trial.params, random_state=42)
569
  return {"family": fam, "model_obj": model, "best_params": params, "cv_score": study.best_value}
570
 
571
  # --- Run button ---