Back to marketplace

04. K-Means Clustering

No description yet. This curated deck is ready for daily study.

Total cards: 13•Content version: v4•Public deck•Updated: 8/1/2026

Card preview (13)

#1
Front (Question)

What is clustering

Back (Answer)

Unsupervised, labels are not proscribed in advance. Clustering is exploratory analysis and does not predict, but determines the objects of interest and how best to group them. Clustering methods find the similarities between objects according to the object attributes and group the similar objects into clusters.

#2
Front (Question)

What does k-means clustering do

Back (Answer)

K-Means clustering partitionsnobjects intokclusters in which each object belongs to the cluster with the nearest mean.

#3
Front (Question)

List use cases for k-means clustering

Back (Answer)

Image Processing, Medical Attributes, Customer Segmentation

#4
Front (Question)

List the steps of the k-means algorithm

Back (Answer)

• Choose/calculate the number of clusters k 2 Select k points at random as clusters • Calculate the distance between objects and every centre (in n dimensions) • Create clusters by assigning objects to their closest cluster • Calculate the centroid of mean of all objects in each cluster • Repeat steps 3, 4 & 5 until the same points are assigned to each cluster in consecutive iterations

#5
Front (Question)

Name the theorem and name of the distance in k-means clustering

Back (Answer)

In two dimensions the Euclidian Distance is the same as in the Pythagorean Theorem SQRT(x2+y2) but in more dimensions this becomes SQRT(x2+y2+z2)

#6
Front (Question)

In R what is the syntax for k-means clustering

Back (Answer)

OutputDataFrame = kmeans(InputDataFrame, 3)

#7
Front (Question)

In k-means clustering what does WSS stand for

Back (Answer)

Within Sum of Squares. Looking for the lowest WSS is used in assessing if its worth increasing or decreasing the chosen number of clusters.

#8
Front (Question)

In k-means clustering when looking at a “Within Sum of Squares” (WSS) graph how do you determine the optimal number of clusters

Back (Answer)

At clusters = 1 the WSS is high, this reduces rapidly as the count of clusters increase, however, the slope flattens out. Look for the elbow where the slope flattens.

#9
Front (Question)

Which three things remain as choices for the user to define for a k-means clustering

Back (Answer)

What object attributes should be included in the analysis? What unit of measure (for example, miles or kilometers) should be used for each attribute? Do the attributes need to be rescaled so that one attribute does not have a disproportionate effect on the results?

#10
Front (Question)

How can you improve the underlying data set for a k-means clustering

Back (Answer)

Reduce the number of attributes where possible. See if there are any strong correlations between attributes (do a scatter plot and look for linear relationships) and either remove or combine these attributes (in a ratio).

#11
Front (Question)

Why does r run multiple k-means methods for the answering of one question

Back (Answer)

The randomly chosen starting centroid can have an effect on the answer, hence, you need to undertake a number of iterations with different starting points to have a more effective result

#12
Front (Question)

What types of data does k-means handle well

Back (Answer)

Numerical data, but not categorical data (ordinal, nominal, binomial)

#13
Front (Question)

What is the R syntax for reviewing a k-means clustering model

Back (Answer)

OutputDataFrame… …$centers cluster means …$size objects per cluster …$cluster vector of objects in clusters …$betweenss the between clusters sum of squares ….$withinss the within cluster sum of squares …$totss withinss + betweenss