├── Credit Risk Modelling in Python.ipynb ├── README.md └── UCI_Credit_Card.csv /README.md: -------------------------------------------------------------------------------- 1 | # Credit-Risk-Modelling-in-Python 2 | Credit risk refers to the chance that a borrower will be unable to make their payments on time and default on their debt. It refers to the risk that a lender may not receive their interest due or the principal lent on time. 3 | 4 | ## More detail explanation 5 | Read in my blogs https://medium.com/mlearning-ai/credit-risk-modelling-in-python-7b21a0b794b1 6 | 7 | ## Objective 8 | The objective of this project is to predict the probability of default on a given obligation, in this case, credit cards. This will allow the generation of strategies that minimize the risk of deterioration of the client's financial health. 9 | 10 | ## Approach 11 | 1. Data preparation and Pre-processing 12 | - Checking missing values 13 | - Outliers removal 14 | - Encoding concept 15 | 2. Feature Engineering and Selection 16 | - features selection 17 | - Scaling the features 18 | - Balancing the data 19 | 3. Model Development and Model Evaluation 20 | - Logistic regression 21 | - Random Forest 22 | - Xgboost 23 | - Hyperparameter tuning 24 | - Cross validation 25 | 26 | ### Dependencies 27 | 28 | * numpy 29 | * matplotlib 30 | * scikit-learn 31 | * XGBOOST 32 | * seaborn 33 | * pyhthon 3.9 34 | 35 | ## Usage 36 | 37 | Just run `jupyter notebook` in terminal and it will run in your browser. 38 | 39 | - Install Jupyter [here](http://jupyter.readthedocs.io/en/latest/install.html) i've you haven't. 40 | 41 | - install xgboost by using `pip install xgb` in command line prompt/ anconda i've you haven't. 42 | 43 | ## Machine learning algorithm 44 | - Logistic regression 45 | - Random Forest 46 | - Xgboost Classifer 47 | - Cross validation 48 | 49 | ## Model Evaluation 50 | - we have acheived the final model accuracy 82% 51 | 52 | ## Steps to run this model in your system 53 | - Clone or download the repo. 54 | - Open command prompt in the downloaded folder 55 | 56 | ## Conclusion: 57 | We have built the credit risk model by using python. we have tried with different machine learning algorithms ie. Logistic regression, Random Forest, and Xgboost classifier. we have also done hyperparameter tuning and cross-validation. The final accuracy of the model we achieved was 82%. 58 | 59 | ## Dataset: 60 | - https://www.kaggle.com/uciml/default-of-credit-card-clients-dataset 61 | 62 | --------------------------------------------------------------------------------