- Table of Contents
- Overview
- Roadmap
- Features
- Project Structure
- Getting Started
- Contributing
- License
- Acknowledgments
Credit Default Prediction β A machine learning project that predicts the likelihood of customer loan default to help financial institutions minimize credit risk. Built with Python, Scikit-learn, and Pandas, the model enhances data-driven lending and supports proactive risk mitigation.
Key Features:
Built predictive models using supervised learning algorithms ( - Linear Regression - KNN - Decision Tree - Random Forest - Stacking Regressor (using the above models as base estimators)).
Performed data cleaning, feature engineering, and model evaluation to ensure accuracy and reliability
Generated actionable insights to support data-driven lending decisions and default mitigation strategies
Tools & Technologies: Python, Scikit-learn, Pandas, NumPy, Matplotlib, Jupyter Notebook, Mlflow
Outcome: Improved prediction accuracy of default risk, enabling proactive financial decision-making and efficient credit portfolio management.
-
Task 1: Perform Data ingestion (Ingesting data either from local-csv/database/API). -
Task 2: Perform Data transformation (train/test split, filling missing values, encoding). -
Task 3: Train the model (Models training). -
Task 4: Perform Model evaluation (Evaluate model; metrics = { "r2_score": r2, "rmse": rmse, "mae": mae } Also setup Mlflow for model & parameter tracking ).
β― ποΈπ Key Features Used
Feature Name
Description
income
Annual income of the applicant
loan_amount
Total amount of the requested loan
loan_term
Duration of the loan in months
interest_rate
Interest rate applied to the loan
debt_to_income_ratio
Ratio of total debt to annual income
employment_years
Years employed at current job
savings_balance
Current savings balance
age
Age of the applicant
βββ /
βββ .github
β βββ workflows
βββ api
β βββ main.py
βββ app.py
βββ artifacts
β βββ data_ingestion
β βββ data_transformation
β βββ model_evaluation
β βββ model_trainer
βββ config
β βββ config.yaml
βββ Dockerfile
βββ LICENSE
βββ logs
β βββ running_logs.log
βββ main.py
βββ notebook
β βββ data
β βββ EDA_DEFAULTPRED.ipynb
β βββ MODEL_TRAINER.ipynb
β βββ trials.ipynb
βββ params.yaml
βββ README.md
βββ requirements-streamlit.txt
βββ requirements.txt
βββ setup.py
βββ src
β βββ defaultMlProj
β βββ defaultMlProj.egg-info
βββ template.py
βββ templates
βββ index.html/
__root__
β¦Ώ __root__
File Name Summary app.py Code>β― Setup our frontend with streamlit Dockerfile Code>β― Build image for model deployment LICENSE Code>β― MIT License main.py Code>β― Executes the data stages params.yaml Code>β― Holds the model parameters requirements-streamlit.txt Code>β― Necessary libraries for running steamlit frontend requirements.txt Code>β― Libraries for running the project setup.py Code>β― Project setup template.py Code>β― Project template file
api
β¦Ώ api
File Name Summary main.py Code>β― FASTAPI
config
β¦Ώ config
File Name Summary config.yaml Code>β― Configuration file
notebook
β¦Ώ notebook
File Name Summary EDA_DEFAULTPRED.ipynb Code>β― Notebook MODEL_TRAINER.ipynb Code>β― Model trainer notebook trials.ipynb Code>β― Trials notebook
templates
β¦Ώ templates
File Name Summary index.html Code>β― HTML file
artifacts
β¦Ώ artifactsmodel_evaluation
β¦Ώ artifacts.model_evaluation
File Name Summary metrics.json Code>β― Store the model metrics model_trainer
β¦Ώ artifacts.model_trainer
File Name Summary model.joblib Code>β― Store model artifacts
src
β¦Ώ srcdefaultMlProj.egg-info
β¦Ώ src.defaultMlProj.egg-info
File Name Summary dependency_links.txt Code>β― Project pypi package links PKG-INFO Code>β― Project pypi package SOURCES.txt Code>β― REPLACE-ME top_level.txt Code>β― REPLACE-ME defaultMlProj
β¦Ώ src.defaultMlProjcomponents
β¦Ώ src.defaultMlProj.components
File Name Summary data_ingestion.py Code>β― Data ingestion file data_transformation.py Code>β― Data transformation file model_evaluation.py Code>β― Model evaluation file model_trainer.py Code>β― Model trainer file config
β¦Ώ src.defaultMlProj.config
File Name Summary configuration.py Code>β― Config file constants
β¦Ώ src.defaultMlProj.constants
File Name Summary constant.py Code>β― Project constants file entity
β¦Ώ src.defaultMlProj.entity
File Name Summary config_entity.py Code>β― Project Config file pipeline
β¦Ώ src.defaultMlProj.pipeline
File Name Summary prediction.py Code>β― Model Prediction file stage_data_ingestion.py Code>β― Data ingestion stage file stage_data_transformation.py Code>β― Data transformation stage file stage_model_evaluation.py Code>β― Model evaluation stage file stage_model_trainer.py Code>β― Model tariner stage file utils
β¦Ώ src.defaultMlProj.utils
File Name Summary common.py Code>β― Common functions project file
This project requires the following dependencies:
- Programming Language: Python
- Package Manager: Pip
- Container Runtime: Docker
Build from the source and intsall dependencies:
-
Clone the repository:
β― git clone ../
-
Navigate to the project directory:
β― cd -
Install the dependencies:
Using docker:
β― docker build -t / .Using pip:
β― pip install -r requirements.txt
Run the project with:
Using docker:
docker run -it {image_name}Using pip:
python {entrypoint}uses the {test_framework} test framework. Run the test suite with:
Using pip:
pytestEach model was evaluated using:
- Mean Squared Error (MSE)
- Root Mean Squared Error (RMSE)
- R-squared (RΒ²) Score
The best performing model selected based on these metrics.
- β Stacking Regressor
- π¬ Join the Discussions: Share your insights, provide feedback, or ask questions.
- π Report Issues: Submit bugs found or log feature requests for the `` project.
- π‘ Submit Pull Requests: Review open PRs, and submit your own PRs.
Contributing Guidelines
- Fork the Repository: Start by forking the project repository to your LOCAL account.
- Clone Locally: Clone the forked repository to your local machine using a git client.
git clone . - Create a New Branch: Always work on a new branch, giving it a descriptive name.
git checkout -b new-feature-x
- Make Your Changes: Develop and test your changes locally.
- Commit Your Changes: Commit with a clear message describing your updates.
git commit -m 'Implemented new feature x.' - Push to LOCAL: Push the changes to your forked repository.
git push origin new-feature-x
- Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
- Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
is protected under the LICENSE License. For more details, refer to the LICENSE file.
- Credit
contributors,inspiration,references, etc.