Professional Documents
Culture Documents
Unsupervised
learning
introduc3on
Machine
Learning
Supervised learning
Training set:
Andrew Ng
Unsupervised learning
Training set:
Andrew Ng
Applica2ons of clustering
Market segmenta3on
Andrew Ng
Clustering
Machine
Learning
K-means
algorithm
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
Andrew Ng
K-means
algorithm
Input:
-
(number
of
clusters)
- Training
set
(drop
conven3on)
Andrew Ng
K-means
algorithm
Randomly
ini3alize
cluster
centroids
Repeat
{
for
=
1
to
:=
index
(from
1
to
)
of
cluster
centroid
closest
to
for
=
1
to
:=
average
(mean)
of
points
assigned
to
cluster
}
Andrew Ng
Weight
T-shirt sizing
Height
Andrew Ng
Clustering
Op3miza3on
objec3ve
Machine
Learning
Andrew Ng
K-means
algorithm
Randomly
ini3alize
cluster
centroids
Repeat
{
for
=
1
to
:=
index
(from
1
to
)
of
cluster
centroid
closest
to
for
=
1
to
:=
average
(mean)
of
points
assigned
to
cluster
}
Andrew Ng
Clustering
Random
ini3aliza3on
Machine
Learning
K-means
algorithm
Randomly
ini3alize
cluster
centroids
Repeat
{
for
=
1
to
:=
index
(from
1
to
)
of
cluster
centroid
closest
to
for
=
1
to
:=
average
(mean)
of
points
assigned
to
cluster
}
Andrew Ng
Random
ini2aliza2on
Should
have
Randomly
pick
training
examples.
Set
equal
to
these
examples.
Andrew Ng
Local op2ma
Andrew Ng
Random
ini2aliza2on
For
i
=
1
to
100
{
Randomly
ini3alize
K-means.
Run
K-means.
Get
.
Compute
cost
func3on
(distor3on)
Andrew Ng
Clustering
Choosing
the
number
of
clusters
Machine
Learning
Andrew Ng
Cost func3on
Cost func3on
Elbow method:
(no. of clusters)
(no. of clusters)
Andrew Ng
Weight
Weight
Height
Height
Andrew Ng