Credit risk analysis and default prediction based on borrower and loan information. The complete workflow (EDA, data preparation, feature engineering, and model training/evaluation) is documented in a notebook.
credit_risk.ipynb: main project notebook (explanations + analysis + models).credit_risk_dataset.csv: dataset in CSV format.function_definitions.py: auxiliary functions used in the notebook (metrics and dummies).requirements.txt: Python dependencies.
- Source: Kaggle, Credit Risk Dataset (
https://www.kaggle.com/datasets/laotse/credit-risk-dataset) - Target:
loan_status(0/1)
- Python 3.10+ (recommended)
Create a virtual environment and install dependencies:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtOpen and run the notebook:
jupyter notebook credit_risk.ipynbAlternatively (if using JupyterLab):
jupyter lab- Dataset overview
- Data wrangling
- Exploratory data analysis (univariate/bivariate/multivariate)
- Principal Component Analysis (PCA)
- Feature engineering and final preparation
- Classification models (KNN, Decision Trees, Random Forest, Logistic Regression, SVM)
- Model comparison and improvement with boosting
If you add/have tests with pytest, you can run:
pytest -q