How abhi0323/machine-learning-based-loan-default-early-warning-system works
This is a loan-default prediction application with a model-training workflow and a Flask prediction interface. Training ingests and splits credit-risk data, transforms features, evaluates candidate classifiers, and saves a processor and model; the web workflow converts submitted fields to a dataframe, loads those artifacts, and returns a default-risk message. The README also describes Azure deployment, but the supplied source does not show its runtime configuration. Shared logging and exception handling are internal support layers; some edges are based on the SOURCE INDEX rather than full-file inspection.
Main entry points: app.py Flask routes · pred_pipeline.py Prediction pipeline · data_ingestion.py Data ingestion · model_trainer.py Model training
Components 16
Model training
- Data ingestion
src/components/data_ingestion.py - Credit-risk data
Notebook/Data/credit_risk.csv - Feature transformation
src/components/data_transformation.py - Model training
src/components/model_trainer.py - Model evaluation
src/utils.py - Model artifacts
artificats
Prediction application
- Flask routes
app.py - Input dataframe
src/pipeline/pred_pipeline.py - Prediction pipeline
src/pipeline/pred_pipeline.py - Prediction form
templates/home.html - Landing page
templates/index.html
Shared support
- Object persistence
src/utils.py - Logging
src/logger.py - Custom exceptions
src/exception.py
Other components
- Loan applicant
- Azure Web App
Connections 31
- Loan applicant → Flask routes: submits fields
README.md - Flask routes → Prediction form: renders form
app.py - Flask routes → Landing page: renders page
app.py - Loan applicant → Prediction form: enters data
- Flask routes → Input dataframe: constructs dataframe
app.py - Flask routes → Prediction pipeline: calls predict
app.py - Input dataframe → Prediction pipeline: provides features
src/pipeline/pred_pipeline.py - Prediction pipeline → Model artifacts: loads model and processor
src/pipeline/pred_pipeline.py - Prediction pipeline → Object persistence: loads objects
src/pipeline/pred_pipeline.py - Prediction pipeline → Flask routes: returns risk score
app.py - Flask routes → Prediction form: renders result
app.py - Credit-risk data → Data ingestion: input source
- Data ingestion → Feature transformation: starts transformation
src/components/data_ingestion.py - Data ingestion → Model training: starts training
src/components/data_ingestion.py - Data ingestion → Credit-risk data: reads CSV
src/components/data_ingestion.py - Feature transformation → Model artifacts: saves processor
src/components/data_transformation.py - Model training → Model evaluation: evaluates candidates
src/components/model_trainer.py - Model training → Model artifacts: saves best model
src/components/model_trainer.py - Model training → Object persistence: saves object
src/components/model_trainer.py - Model evaluation → Object persistence: uses model search
src/utils.py - Flask routes → Azure Web App: deployed on
README.md - Data ingestion → Logging: logs activity
src/components/data_ingestion.py - Feature transformation → Logging: logs activity
src/components/data_transformation.py - Model training → Logging: logs activity
src/components/model_trainer.py - Prediction pipeline → Logging: logs activity
src/pipeline/pred_pipeline.py - Custom exceptions → Logging: imports logger
src/exception.py - Data ingestion → Custom exceptions: raises on failure
src/components/data_ingestion.py - Feature transformation → Custom exceptions: raises on failure
src/components/data_transformation.py - Model training → Custom exceptions: raises on failure
src/components/model_trainer.py - Prediction pipeline → Custom exceptions: raises on failure
src/pipeline/pred_pipeline.py - Object persistence → Custom exceptions: raises on failure
src/utils.py