Predicts weather the credit card holder is DEFAULT or not.
To predict whether a credit card customer is a defaulter, using numerical and Categorical Data.
Apply ML and DL Models to predict the severity and probability of the Credit Card Defaulter.
Create a Wonderful UI for this project using Front End Languages and Frameworks (Like Bootstrap, HTML/CSS, JavaScript).
Create the Backend using Flask Framework.
Deploy on Cloud and make this wonderful project available to public
Financial threats are displaying a trend about the credit risk of commercial banks as the incredible improvement in the financial industry has arisen. In this way, one of the biggest threats faces by commercial banks is the risk prediction of credit clients. The goal is to predict the probability of credit default based on credit card owner's characteristics and payment history.
For building the project I have used “Default of Credit Card Clients” dataset released under the public liscense of Creative Commons and available on the Kaggle website. This dataset contains information on default payments, demographic factors, credit data, history of payment, and bill statements of credit card clients from April 2005 to September 2005. This dataset contains 30000 observations of 25 variables from a bank (and also a cash and credit card issuer); where each observation corresponds to a particular credit card client. Among the total 30000 observations, 6636 observations (22.1%) are cardholders with default payment.
The data is prepossessed, validate and scaled. I have trained with Random forest Classifier, and Gaussain Naive Bayes algorithms. To provide an easy-to-use interface to users. I have developed a website that will take the data and display the output with accuracy and time taken to predict. For the evalution or accuracy of our model I have used F1 Score. F1 Score is the weighted average of Precision and Recall. Therefore, this score takes both false positives and false negatives into account. Intuitively it is not as easy to understand as accuracy, but F1 is usually more useful than accuracy, especially if you have an uneven class distribution.
Client: HTML, CSS, JavaScript, Boootstrap.
Server: Python, Flask, Pandas, Numpy, Sklearn.
Deployment: Heroku.
- Environment Variables
To run this project, you will need to add the following environment variables:
conda create -p venv python -y
conda activate venv
pip install -r requirements.txt
- run the app.py as python app.py
- Web Application will be hosted at 127.0.0.1:5000
- Enter the URL in the browser Application will be hosted.
- Enter the details of the credit card owner for prediction.
Steps to follow 📜
Star the repo by pressing the topmost-right button to start your wonderful journey.
NOTE: commands are to be executed on Linux, Mac, and Windows
Cloning a repository.
Run the cammond in Git or CMD
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY-NAME.git
This makes a local copy of the repository in your machine.
Once you have cloned the repository in Github, move to that folder first using change directory command on Linux, Mac, and Windows
# This will change directory to a folder
$ cd YOUR-REPOSITORY-NAME
Move to this folder for all other commands.
Run the following commands to see that your local copy has a reference to your forked remote repository in Github
$ git remote -v
origin https://github.com/Your_Username/YOUR-REPOSITORY-NAME.git (fetch)
origin https://github.com/Your_Username/YOUR-REPOSITORY-NAME.git (push)
Now, let's add a reference to the original Credit-Card-Default-Prediction-ML-Project repository using
$ git remote add upstream https://github.com/prathmesh-jagtap/Credit-Card-Default-Prediction-ML-Project.git
This adds a new remote named upstream.
See the changes using
$ git remote -v
origin https://github.com/Your_Username/Credit-Card-Default-Prediction-ML-Project.git (fetch)
origin https://github.com/Your_Username/Credit-Card-Default-Prediction-ML-Project.git (push)
upstream https://github.com/Remote_Username/Credit-Card-Default-Prediction-ML-Project.git (fetch)
upstream https://github.com/Remote_Username/Credit-Card-Default-Prediction-ML-Project.git (push)
In your case, you will see
$ git remote -V
origin https://github.com/Your_Username/Credit-Card-Default-Prediction-ML-Project.git (fetch)
origin https://github.com/Your_Username/Credit-Card-Default-Prediction-ML-Project.git (push)
upstream https://github.com/manan-bedi2908/Credit-Card-Default-Prediction-ML-Project.git (fetch)
upstream https://github.com/manan-bedi2908/Credit-Card-Default-Prediction-ML-Project.git (push)
Always keep your local copy of the repository updated with the original repository. Before making any changes and/or in an appropriate interval, run the following commands carefully to update your local repository.
# Fetch all remote repositories and delete any deleted remote branches
$ git fetch --all --prune
# Switch to `New_Pipeline` branch
$ git checkout New_pipeline
# Reset local `main` branch to match the `upstream` repository's `main` branch
$ git reset --hard upstream/main
# Push changes to your forked `Breast-Cancer-Predictor` repo
$ git push -u origin New_pipeline
Once you have completed these steps, you are ready to start contributing to the project and creating pull requests.
Whenever you are going to contribute. Please create a separate branch using command and keep your main
branch clean (i.e. synced with remote branch).
# It will create a new branch with name Branch_Name and switch to branch Folder_Name
$ git checkout -b New_pipeline
Create a separate branch for contribution and try to use the same name of the branch as of folder.
To switch to the desired branch
# To switch from one folder to other
$ git checkout New_pipeline
To add the changes to the branch. Use
# To add all files to branch Folder_Name
$ git add .
Type in a message relevant for the code reviewer using
# This message get associated with all files you have changed
$ git commit -m '<message>'
Now, Push your awesome work to your remote repository using
# To push your work to your remote repository
$ git push -u origin New_pipeline
(Kindly push all the changes to the "New_pipeline", not main branch)
Finally, go to your repository in the browser and click on compare and pull requests
.
Then add a title and description to your pull request that explains your precious effort.
To deploy this project or heroku we need 3 information
- HEROKU_EMAIL = jagtaprathmesh19@gmail.com
- HEROKU_API_KEY = < Locatied in settings of your heroku account >
- HEROKU_APP_NAME = < Name of your heroku app >
Build Docker Image
docker build -t <image_name>:<tagname> .
Note: Image name for docker must be lowercas
To list out docker images
docker images
Run docker image
docker run -p 5000:5000 -e PORT=5000 187e678ae51c
To stop docker conatiner
docker stop <container_id>
Here are some related projects
If you have any feedback, please reach out to us at Feedback