Customer Spent Analysis Using K-Means Clustering
Customer Spent Analysis Using K-Means Clustering
dataset = pandas.read_csv('dataset.csv')
No. of
Rows &
Load Dataset from the directory & Columns
Summarize the details such as no. of rows
3 Load, Summarize and Columns & Content
dataset.shape
Display 1st 5
rows of dataset
dataset.head(5)
Income = dataset['INCOME'].values
Spend = dataset['SPEND'].values
4 Segregating & Zipping Dataset Numpy X = np.array(list(zip(Income, Spend)))
Customer spent
analysis using K- To find the closest cluster, so we will
repeat the process by choosing a new
Means Clustering 4 centroid
Steps
Inertia
A good model is one with low inertia AND
a low number of clusters ( K )