How codedbankai/ecopack_deploy works
This is a Flask service for recommending sustainable packaging. A user supplies product category, subcategory, weight, fragility, and eco preference; the service scores candidate materials using trained cost and CO₂ models, returns the top recommendations, and attempts to save the leading result to PostgreSQL. The graph follows the calls visible in app.py. The template and model artifacts are present in the tree, but their internals and the template’s request wiring were not sampled.
Main entry points: app.py Recommendation logic · index.html Recommendation page · final_engineered_dataset.csv Candidate dataset · le_cat.pkl Category encoders
Components 12
Web interface
- Flask routes
app.py - Recommendation page
templates/index.html
Recommendation
- Recommendation logic
app.py - Candidate dataset
final_engineered_dataset.csv
Prediction models
- Category encoders
le_cat.pkl - Subcategory encoder
le_sub.pkl - Feature pipeline
pipeline.pkl - Cost model
rf_cost_model.pkl - CO2 model
xgb_co2_model.pkl
History storage
- History model
app.py - PostgreSQL
Other components
- User
Connections 13
- User → Flask routes: submits request
- Flask routes → Recommendation page: renders
app.py - Recommendation page → Flask routes: sends request
- Flask routes → Recommendation logic: gets recommendations
app.py - Recommendation logic → Candidate dataset: reads candidates
app.py - Recommendation logic → Category encoders: encodes category
app.py - Recommendation logic → Subcategory encoder: encodes subcategory
app.py - Recommendation logic → Feature pipeline: transforms features
app.py - Recommendation logic → Cost model: predicts cost
app.py - Recommendation logic → CO2 model: predicts CO2
app.py - Recommendation logic → Flask routes: returns results
app.py - Flask routes → History model: creates entry
app.py - History model → PostgreSQL: commits history
app.py