How vkous/projet7-openclassrooms works
This repository implements a credit-default scoring product: a customer ID enters through a Flask API, which returns a prediction and probability; a Streamlit dashboard presents that result and adds explanations, customer comparisons, and what-if scoring. The prediction module also contains LIME-based explanation and feature-translation logic. Preprocessing is a separate, substantial data-preparation script, while the repository includes serialized model artifacts. The shown code does not establish how preprocessing produced those artifacts or which artifact matches its hard-coded model paths.
Main entry points: predict.py Prediction engine · dashboard.py Scoring dashboard · app.py Scoring API · preprocess.py Feature preparation
Components 13
User interfaces
- Scoring API
app.py - Scoring dashboard
dashboard.py
Scoring runtime
- Prediction engine
toolbox/predict.py - Serialized models
models/RFC_Sample_Weights_Total.obj - Stacked model artifact
models/Stacked_GradientBoosting_Sample_Weights_Total_export_natif.obj - Gradient model artifact
models/GradientBoosting_Sample_Weights_Total_export_natif.obj
Decision support
- LIME explanations
toolbox/predict.py - Similar-customer comparison
toolbox/predict.py - Feature translation
toolbox/predict.py - What-if scoring
toolbox/predict.py
Data preparation
- Feature preparation
toolbox/preprocess.py - Credit application data
Other components
- Credit manager
Connections 13
- Credit manager → Scoring dashboard: enters client ID
dashboard.py - Scoring dashboard → Scoring API: requests score
dashboard.py - Scoring API → Prediction engine: calls prediction
app.py - Scoring dashboard → LIME explanations: requests explanation
dashboard.py - Scoring dashboard → What-if scoring: recalculates score
dashboard.py - Scoring dashboard → Feature translation: translates features
dashboard.py - LIME explanations → Similar-customer comparison: compares neighbors
toolbox/predict.py - LIME explanations → Prediction engine: uses prediction function
toolbox/predict.py - What-if scoring → Prediction engine: calls prediction
toolbox/predict.py - Feature preparation → Credit application data: reads and transforms
toolbox/preprocess.py - Prediction engine → Serialized models
- Prediction engine → Stacked model artifact
- Prediction engine → Gradient model artifact