This project involves analyzing the German Credit dataset to predict credit risk (Good or Bad) using machine learning techniques. It focuses on data cleaning, exploratory data analysis (EDA), data preprocessing, clustering, and classification. The analysis aims to provide insights into the key factors affecting credit risk and improve the accuracy of credit scoring.
The goal of this project is to analyze the German Credit dataset and develop a classification model that predicts whether a credit applicant is a good or bad risk. This involves:
- Data preprocessing and cleaning.
- Exploratory Data Analysis (EDA) to uncover insights.
- Building and evaluating machine learning models.
The dataset contains information about 1,000 credit applicants, including attributes such as:
- Age: Age of the individual
- Sex: Gender of the individual
- Job: Type of job (0 - Unskilled & Non-Resident, 1 - Unskilled & Resident, 2 - Skilled, 3 - Highly Skilled)
- Housing: Housing status (Own, Rent, or Free)
- Saving Accounts: Savings account balance
- Checking Account: Checking account balance
- Credit Amount: Amount of credit taken
- Duration: Duration of the credit in months
- Purpose: Purpose of the credit (e.g., car, education, etc.)
Target Variable:
- Risk:
Good(1) orBad(0)
The dataset can be found in Kaggle: German Credit Analysis || A Risk Perspective
- Programming Language: Python
- Libraries:
- Pandas
- NumPy
- Matplotlib
- Seaborn
- Scikit-learn
- Machine Learning Techniques:
- Random Forest Classifier
- PCA
- KMeans Clustering
- Exploratory Data Analysis (EDA):
- Visualize data distributions.
- Handle missing values and perform log transformations.
- Clustering and PCA:
- Use KMeans clustering to identify patterns.
- Apply PCA for dimensionality reduction and visualization.
- Classification Model:
- Random Forest Classifier to predict credit risk.
- Evaluation using confusion matrices, classification reports, and ROC AUC scores.
- Confusion Matrix Visualization:
- Heatmap visualization for clear interpretation of classification results.
- Clone the repository:
git clone https://github.com/aritro98/German-Credit-Analysis.git
- Navigate to the project directory:
cd German-Credit-Analysis - Install the required Python libraries:
pip install -r requirements.txt
- Open the Jupyter Notebook:
jupyter notebook German_Credit_Data.ipynb
- Run the cells to explore the data, perform analysis, and build machine learning models.
The project successfully identifies patterns in credit data and predicts credit risk with the following highlights:
- Classification Accuracy: Achieved using a Random Forest model.
- Confusion Matrix: Provides clear insights into true positives, true negatives, false positives, and false negatives.
- ROC AUC Score: Indicates the model's ability to distinguish between Good and Bad credit risk.