K-Means Clustering : Performing Customer Segmentation

Share At:


k-means is a Kind of Machine Learning Model which uses clustering technique and unsupervised approach. Using k-means clustering we can quickly get insights from unlabeled data.

Using k-means for Customer Segmentation

Customer segmentation is the practice of partitioning a customer base into groups of individuals that have similar characteristics.

It is a significant strategy as a business can target these specific groups of customers and effectively allocate marketing resources.

For example, one group might contain customers who are high-profit and low-risk, that is, more likely to purchase products, or subscribe to a service. A business task is to retain those customers.

Importing Libraries

We will be importing important libraries which is needed for the analysis.

Downloading Data

We will now be downloading the Dataset which will be worked upon

Read the data

Getting Insights from data and dealing with Missing values

We can drop “Address” Column which is not in much use for Feature selection. Moreover this is categorical values while K-means uses numerical values.

Using StandardScaler to standardize the dataset.


Lets Draw Elbow Curve


Let’s run our model and group our customers into three clusters.


Note that each row in our dataset represents a customer, and therefore, each row is assigned a label.


We can easily check the centroid values by averaging the features in each cluster

Visualizing Data using lmplot


k-means cluster has partitioned the customers into three groups since we specified the algorithm to generate 3 clusters.

The customers in each cluster are similar to each other in terms of the features included in the dataset.

Now we can create a profile for each group, considering the common characteristics of each cluster. For example, the 3 clusters can be:


Actionable Insights

From the above plot it can be easily seen that Customers segmented as “Label-0” are the one who has “Never Defaulted” the payment.

We can also see that Label-0 customers have “years of experience” more than “Label-2” however less than “Label-1” Customers.

We can easily say that the Label2 Customers who has average experience as 3.689 years of employment are more likely to Default the payment.

Hence The Actionable insights would be:

  1. The customers having very less Employment years are most likely to default the payment.
  2. Customers have Employment years more than 10 years are highly indebted and most likely to default the payment

3. Only Customers having Employment years averaging 7 years are the one who most likely will never default. So its wise to give loans to such customers.

I hope you enjoyed the reading. This clustering algorithm provided us with insight into the dataset and lead us to group the data into three clusters.

Perhaps the same results would have been achieved but using multiple tests and experiments.

Happy Reading !!!

Share At:
0 0 votes
Article Rating
Notify of
Oldest Most Voted
Inline Feedbacks
View all comments
registrera dig för binance

Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

gümüşhane eğitim sitesi

thank you

how to lose weight
1 year ago

I love your blog.. very nice colors & theme.
Did you design this website yourself or did you hire someone
to do it for you? Plz answer back as I’m looking how to lose weight
construct my own blog and would like to find out where
u got this from. thanks a lot

boost libido exercise

We wish to thank you once again for the stunning ideas you offered Jesse when preparing her
own post-graduate research in addition to, most importantly, for providing each of the ideas
within a blog post. Provided we had been aware of your web
page a year ago, we’d have been kept from the unwanted measures we were taking.
Thanks to you.

Here is my site: boost libido exercise

prescription drug abuse

You could definitely see your enthusiasm in the work you
write. The arena hopes for more passionate writers
like you who aren’t afraid to say how they believe. At all times go
after your heart.

Also visit my page: prescription drug abuse

cyclical ketogenic
1 year ago

Hi are using WordPress for your blog platform? I’m new
to the blog world but I’m trying to get started and create my own. Do you need any html coding expertise to make
your own blog? Any help would be really appreciated!

Check out my blog post :: cyclical ketogenic

1 year ago

Howdy! Do you know if they make any plugins to assist with SEO?
I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
If you know of any please share. Kudos!

1 year ago

It’s going to be ending of mine day, however before end I am reading this impressive piece of writing to improve my experience.

quality treatment
1 year ago

After I initially commented I appear to have clicked the -Notify me when new comments are added- checkbox and from
now on every time a comment is added I recieve 4 emails with the
exact same comment. There has to be an easy method you can remove me from that service?

my page … quality treatment

ketosis diets
1 year ago

Hello.This post was extremely motivating,
particularly because I was investigating for thoughts on this topic last Saturday.

My web-site: ketosis diets

1 year ago

magnificent post, very informative. I’m wondering why the other
specialists of this sector do not notice this.

You must proceed your writing. I am confident, you have a great readers’ base already!

cannabis seeds exist

Ahaa, its pleasant discussion on the topic of this post
here at this web site, I have read all that, so now me also commenting at this place.

Also visit my homepage – cannabis seeds exist

1 year ago

Provided these challenges of self-control, my assistance is uncomplicated.


Hi there, just became aware of your blog through Google, and found that it’s truly informative.
I am going to watch out for brussels. I’ll appreciate
if you continue this in future. Numerous people will be benefited from your writing.

Feel free to surf to my web blog … http://lnx.gildafc.eu

healthy diets
1 year ago

Thank you for the sensible critique. Me & my neighbor were just preparing to do some research on this.
We got a grab a book from our area library but I think I learned more
clear from this post. I am very glad to see such magnificent information being shared
freely out there.

My homepage healthy diets

hizli takipçi satın al

Your mode of explaining the whole thing in this piece of writing is in fact pleasant, every one can easily know it, Thanks a lot.

ucuz takipçi satın al

When someone writes an article he/she maintains the thought of a user in his/her mind that how a user can understand it.
So that’s why this piece of writing is amazing.

indoor growing
1 year ago

I think this is one of the most important info for me.
And i am glad reading your article. But wanna remark
on few general things, The site style is wonderful,
the articles is really great : D. Good job, cheers

Have a look at my webpage – indoor growing


This is a topic that is near to my heart… Best wishes! Where are your
contact details though?

Look at my website … http://cozumubuldum.com/

term treatment
1 year ago

I got this website from my pal who told me regarding this web page and now this time I am browsing this web page and reading very informative
articles or reviews at this time.

my homepage … term treatment

파워볼 픽
1 year ago

The cost of playing increases as you enter far
more combinations, but your chances of winning also increase.

male skin
1 year ago

Hello. excellent job. I did not imagine this. This is a splendid story.

My web blog; male skin

tips on healthy eating

Hello.This post was really motivating, especially
since I was looking for thoughts tips on healthy eating this topic last Tuesday.

1 year ago

Very good information. Lucky me I ran across your blog by chance (stumbleupon).
I’ve book marked it for later!

potatoes diet
1 year ago

Marvelous, what a weblog it is! This web site gives useful information to us, keep it up.

Take a look at my site potatoes diet

1 year ago

I couldn?t resist commenting. Well written!

Here is my blog post … http://www.sssr.free.fr

quick weight loss pills

I’m now not certain the place you are getting your info, but good topic.
I needs to spend some time studying more or working out more.
Thank you for excellent information I was in search of this information for my mission.

Feel free to surf to my web site :: quick weight loss pills

1 year ago

Thank you, I have recently been looking for information approximately this subject for
ages and yours is the best I have found out so far. But, what about the bottom line?
Are you sure in regards to the supply?
1 year ago

Rattling superb information can be found on blog.

Feel free to surf to my web page … natural skin care (

care personal skin
1 year ago

Awesome! Its in fact amazing article, I have got much clear idea regarding from this paragraph.

Review my website … care personal skin

weed indoorshave
1 year ago

I conceive you have remarked some very interesting details, thank you for the post.

Have a look at my web-site … weed indoorshave

skin products
1 year ago

Really no matter if someone doesn’t be aware of then its up to other viewers that they will help, so here it takes place.

Also visit my blog – skin products


I wanted to thank you for this good read!! I absolutely loved every
bit of it. I have you book-marked to look at new things you post?

My webpage https://247fruitmachines.com/forum/index.php?action=profile;u=3482

1 year ago

Wonderful, what a webpage it is! This weblog gives helpful
information to us, keep it up.

diets that work
1 year ago

Hey I know this is off topic but I was wondering if you knew of
any widgets I could add to my blog diets that work automatically tweet my newest twitter updates.
I’ve been looking for a plug-in like this for quite some time and was
hoping maybe you would have some experience with something like this.
Please let me know if you run into anything.
I truly enjoy reading your blog and I look forward
to your new updates.

low carb eating
1 year ago

I love your blog.. very nice colors & theme. Did you make this website yourself or did you hire someone to do it for you?
Plz answer back as I’m looking to construct my own blog and would like to know where u
got this from. many thanks

Also visit my web-site; low carb eating


Thanks for all your efforts that you have put in this.
Very interesting info.

my web-site; natural testosterone (http://forum.m2clasic.ro)

increase testosterone

I think this is among the most significant info for me.
And i am glad reading your article. However want to remark on few normal issues, The website style is perfect, the
articles is in reality nice : D. Good process, cheers

Feel free to visit my homepage: increase testosterone

Back To Top

Contact Us