File size: 3,874 Bytes
d636394
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a538c2b
d636394
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# Credit Card Clustering with Machine Learning

This project focuses on clustering credit card customers based on their usage behavior using unsupervised machine learning techniques. The goal is to segment customers for better targeting, offers, and personalized financial services.

## 📌 Objective

- Understand customer behavior from credit card usage.
- Segment customers into clusters with similar patterns.
- Help financial institutions create targeted marketing strategies.

## 📊 Dataset

- Source: [Aman Kharwal’s GitHub Dataset](https://raw.githubusercontent.com/amankharwal/Website-data/master/credit_card.csv)
- Contains features like:
  - `BALANCE`: Average balance
  - `PURCHASES`: Total purchases
  - `CREDIT_LIMIT`: Assigned credit limit
  - `PAYMENTS`: Amount paid
  - `TENURE`: Months as a customer
  - `ONEOFF_PURCHASES`, `INSTALLMENTS_PURCHASES`, etc.

## 🧹 Data Preprocessing

- Checked for null values and handled them
- Dropped irrelevant columns (e.g., `CUST_ID`)
- Scaled data using `StandardScaler`

## 🧠 Clustering Algorithm

- Used **KMeans** algorithm
- Determined optimal number of clusters using:
  - Elbow Method
  - Silhouette Score

## 📉 Dimensionality Reduction

- Applied **PCA** for visualizing clusters in 2D space

## 📈 Results & Analysis

- Clusters represent different types of customers:
  - High spenders
  - Low activity users
  - Customers using mostly installments
- Visualized clusters using `matplotlib` and `seaborn`

## 📦 Libraries Used

- `pandas`
- `numpy`
- `matplotlib`, `seaborn`
- `scikit-learn`

## 🔍 Future Improvements

- Try alternative clustering algorithms like DBSCAN, GMM
- Add deeper feature engineering
- Include time-based features for trend analysis

## 💻 How to Run

1. Clone the repo:
    ```bash

    git clone https://github.com/handecrkc/credit-card-clustering.git

    ```


2. Install requirements:
    ```bash

    pip install -r requirements.txt

    ```


3. Run the notebook:
    Open `credit_card_clustering.ipynb` in Jupyter Notebook or VS Code


---

## 🧑‍💻 Author

- **Hande Çarkcı**  
- GitHub: [github.com/handecrkc](https://github.com/handecrkc)


# 💳 Credit Card Clustering – Streamlit App

Bu proje, müşterilerin kredi kartı kullanım alışkanlıklarına göre segmentlere ayrılmasını sağlayan bir **Makine Öğrenimi** uygulamasıdır.  
Streamlit ile geliştirilen bu uygulama sayesinde kullanıcıdan alınan veriye göre müşterinin ait olduğu küme tahmin edilir.

## 🎯 Proje Amacı

- Kredi kartı kullanıcılarını **benzer davranış gruplarına ayırmak**
- Finansal kurumlara **hedefli pazarlama stratejileri** sağlamak
- Kullanıcıya ait segmenti gerçek zamanlı olarak tahmin etmek

## 🧠 Kullanılan Yöntem

- **KMeans Clustering**
- **StandardScaler** ile veri ölçekleme
- **Streamlit** ile web uygulaması

## 🗃️ Kullanılan Veri Seti

- Kaynak: [`CC GENERAL.csv`](https://raw.githubusercontent.com/amankharwal/Website-data/master/credit_card.csv)
- Sütunlar: `BALANCE`, `PURCHASES`, `CREDIT_LIMIT`, `PAYMENTS`, `TENURE`, vb.

## 🚀 Uygulamayı Çalıştırmak

```bash

git clone https://github.com/kullanici_adin/credit-card-clustering-streamlit.git

cd credit-card-clustering-streamlit

pip install -r requirements.txt

streamlit run app.py





🖼️ Uygulama Görünümü



🔍 Küme Açıklamaları

Küme	Açıklama

0	🟢 Düşük harcama yapan, düşük riskli müşteri

1	🟡 Orta seviyede harcama yapan müşteri

2	🔴 Yüksek harcama yapan ve aktif müşteri

3	🔵 Taksitli harcamaları yüksek olan müşteri



🛠️ Gereken Kütüphaneler

streamlit



pandas



numpy



scikit-learn



joblib





## 📜 License



This project is open-source under the MIT License.