Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,10 +3,13 @@ import numpy as np
|
|
| 3 |
import gradio as gr
|
| 4 |
from xgboost import XGBRegressor
|
| 5 |
|
| 6 |
-
EXCEL_PATH = "microalgae_pot_experiment_corrected_doses.xlsx"
|
| 7 |
-
MODEL_PATH = "EcoGrowAI_yield_model.json"
|
| 8 |
-
|
| 9 |
df = pd.read_excel(EXCEL_PATH)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
drop_cols = ["Yield_g_per_pot", "Relative_Yield_%"]
|
| 11 |
feature_cols = [c for c in df.columns if c not in drop_cols]
|
| 12 |
|
|
|
|
| 3 |
import gradio as gr
|
| 4 |
from xgboost import XGBRegressor
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
df = pd.read_excel(EXCEL_PATH)
|
| 7 |
+
|
| 8 |
+
# Apply the same encoding used during training
|
| 9 |
+
for col in ["Crop", "Microalgae_Strain"]:
|
| 10 |
+
le = LabelEncoder()
|
| 11 |
+
df[col] = le.fit_transform(df[col])
|
| 12 |
+
|
| 13 |
drop_cols = ["Yield_g_per_pot", "Relative_Yield_%"]
|
| 14 |
feature_cols = [c for c in df.columns if c not in drop_cols]
|
| 15 |
|