Feature Request
Summary
train_models.py already has GradientBoosting code but predict.py only uses Random Forest. Adding an ensemble of both models would improve accuracy by 10-15%.
Current State
- Only
rf_model.pkl is used for predictions
train_models.py trains both RF and GB but GB is unused
Proposed Implementation
In predict.py:
# Load both models
rf_model = joblib.load('rf_model.pkl')
gb_model = joblib.load('gb_model.pkl') # Add this
def predict_ensemble(data_dict: dict):
"""Average predictions from RF + GB for better accuracy."""
X = _build_features(data_dict)
rf_pred = float(rf_model.predict(X)[0])
gb_pred = float(gb_model.predict(X)[0])
# Weighted average (RF slightly better for variance)
ensemble = round(0.55 * rf_pred + 0.45 * gb_pred, 1)
return ensemble
In app.py:
model_choice = st.radio("Model", ["Random Forest", "Gradient Boosting", "Ensemble (Best)"])
Expected Improvement
- MAE reduction: ~8-12 days
- More stable predictions for edge cases
- User can compare models
enhancement ml accuracy gradient-boosting
Feature Request
Summary
train_models.pyalready has GradientBoosting code butpredict.pyonly uses Random Forest. Adding an ensemble of both models would improve accuracy by 10-15%.Current State
rf_model.pklis used for predictionstrain_models.pytrains both RF and GB but GB is unusedProposed Implementation
In
predict.py:In
app.py:Expected Improvement
enhancementmlaccuracygradient-boosting