File size: 1,088 Bytes
b502db6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

tags:

\- machine-learning

\- clustering

\- k-means

\- customer-segmentation




\# Customer Segmentation K-Means Model



This repository contains a K-Means clustering model for customer segmentation.



\## Model Description

The model segments customers based on three features: `Age`, `Annual Income (k$)`, and `Spending Score (1-100)`. K-Means clustering was chosen due to its simplicity, efficiency for this type of unsupervised task, and the interpretability of the resulting clusters. The optimal number of clusters was determined using the Elbow Method.



\## Training Data

The model was trained on a dataset of \*\*200 customers\*\*, with features: `Age`, `Annual Income (k$)`, and `Spending Score (1-100)`.



\## Usage

To use this model for prediction, you need to provide input in the format:

`{"age": <int>, "annual\_income": <float>, "spending\_score": <float>}`



\## Example

\*\*Input:\*\*

`{"age": 30, "annual\_income": 50, "spending\_score": 60}`



\*\*Output (example):\*\*

`{"cluster\_id": 1}`