Customer Segmentation Report
Customer Segmentation Report
Submitted By:
Roll No : 102103022
Roll No : 102103024
Submitted To:
This data set is created only for the learning purpose of the customer
segmentation concepts, also known as market basket analysis. I will
demonstrate this by using unsupervised ML technique (KMeans Clustering
Algorithm) in the simplest form.
import numpy as np
import pandas as pd
print(customer_data.head())
print(customer_data.shape)
print(customer_data.info())
print(customer_data.isnull().sum())
X = customer_data.iloc[:,[3,4]].values
print(X)
wcss = []
for i in range(1,11):
kmeans.fit(X)
wcss.append(kmeans.inertia_)
sns.set()
plt.plot(range(1,11), wcss)
plt.xlabel('Number of Clusters')
plt.ylabel('WCSS')
plt.show()
Y = kmeans.fit_predict(X)
print(Y)
plt.figure(figsize=(8,8))
plt.title('Customer Groups')
plt.xlabel('Annual Income')
plt.ylabel('Spending Score')
plt.show()