ashaddams commited on
Commit
8f84fd0
·
verified ·
1 Parent(s): e67f626

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -604,9 +604,7 @@ def preprocess_row(species, media, light, expo_day, expo_night, temp_c, ph, days
604
  "expo_day": expo_day, "expo_night": expo_night,
605
  "_c": temp_c, "ph": ph, "days": days
606
  }], columns=FEATURES)
607
-
608
- # encode categoricals — robust to unseen labels
609
- for col in bundle.categorical_cols:
610
  if col in X.columns:
611
  enc = bundle.encoders[col]
612
  def _to_known_code(v):
@@ -622,6 +620,8 @@ for col in bundle.categorical_cols:
622
  # impute (KNN uses THIS imputer)
623
  row = pd.DataFrame(imputer.transform(row[FEATURES]), columns=FEATURES)
624
  return row
 
 
625
 
626
  # -----------------------------
627
  # Uncertainty engine (KNN from augmented)
 
604
  "expo_day": expo_day, "expo_night": expo_night,
605
  "_c": temp_c, "ph": ph, "days": days
606
  }], columns=FEATURES)
607
+ for col in bundle.categorical_cols:
 
 
608
  if col in X.columns:
609
  enc = bundle.encoders[col]
610
  def _to_known_code(v):
 
620
  # impute (KNN uses THIS imputer)
621
  row = pd.DataFrame(imputer.transform(row[FEATURES]), columns=FEATURES)
622
  return row
623
+
624
+
625
 
626
  # -----------------------------
627
  # Uncertainty engine (KNN from augmented)