Clustering: K-means and Hierarchical

Serrano.Academy
27 Jan 201917:22

Summary

TLDRIn this video, Luis Serrano explains two popular clustering algorithms: k-means and hierarchical clustering, both used in unsupervised learning to group data. Through a marketing example involving customer segmentation, he demonstrates how clustering works by grouping individuals based on their age and engagement with a page. The k-means algorithm is illustrated using a pizza parlor analogy, where locations are optimized to serve customers. Additionally, the hierarchical method is introduced to create clusters based on proximity. Luis highlights clustering’s applications in marketing, biology, and social networks.

Takeaways

  • 😀 Clustering is a type of unsupervised learning that involves grouping data points based on similarities.
  • 📊 Two main clustering algorithms covered are k-means clustering and hierarchical clustering.
  • 📈 In a marketing application, clustering can be used for customer segmentation to design different strategies for distinct groups.
  • 🧑‍💻 K-means clustering works by starting with random points, assigning data to the nearest center, and adjusting until clusters are optimized.
  • 🍕 K-means clustering can be visualized through a pizza parlor analogy, where the goal is to place stores closest to their customer groups.
  • 📉 The 'elbow method' helps decide the optimal number of clusters by evaluating the diameter of groups and identifying the best point for clustering.
  • 🏙 Hierarchical clustering builds clusters by joining the two closest points or groups iteratively, and a dendrogram is used to visualize these connections.
  • ✂️ Decisions in hierarchical clustering, like where to cut the dendrogram, are partially manual but informed by data.
  • 🌐 Clustering has broad applications in marketing, genetics, social networks, and recommendation systems.
  • 🧬 Social networks use clustering to group similar users and recommend content or connections based on demographic and behavioral similarities.

Q & A

  • What is clustering, and how is it defined in this video?

    -Clustering is a type of unsupervised learning that consists of grouping data into distinct clusters. The algorithm identifies groups based on similarities in the data, even when the data appears to be scattered.

  • What are the two clustering algorithms discussed in this video?

    -The two clustering algorithms discussed in this video are k-means clustering and hierarchical clustering.

  • What application of clustering is mentioned at the beginning of the video?

    -The video mentions customer segmentation for marketing as an application of clustering. The goal is to create three marketing strategies by dividing potential customers into well-defined groups based on their age and engagement levels.

  • How does the k-means clustering algorithm work?

    -In k-means clustering, the computer starts by placing 'k' random points, assigns data points to the closest cluster, and moves each cluster center to the average location of the points assigned to it. This process repeats until clusters stabilize.

  • What is the elbow method in k-means clustering?

    -The elbow method is used to determine the optimal number of clusters by running the algorithm for different numbers of clusters and plotting the diameter (largest distance between two points in the same cluster). The 'elbow' in the plot indicates the best number of clusters.

  • Why is hierarchical clustering different from k-means clustering?

    -Hierarchical clustering is different because it creates a hierarchy of clusters by repeatedly merging the closest data points or clusters, while k-means starts with a fixed number of clusters and adjusts their positions iteratively.

  • What is a dendrogram in hierarchical clustering?

    -A dendrogram is a tree-like diagram that represents the hierarchy of clusters in hierarchical clustering. It helps visualize how data points are grouped together based on their proximity.

  • How do you determine the number of clusters in hierarchical clustering?

    -In hierarchical clustering, the number of clusters can be determined by cutting the dendrogram at a certain height, based on how close the points are or by specifying how many clusters you want.

  • What real-world applications of clustering are mentioned in the video?

    -The video mentions applications of clustering in genetics, evolutionary biology, recommendation systems (e.g., video suggestions), and social networks, where clustering is used to group users based on behavior or demographics.

  • How does clustering help in social networks?

    -In social networks, clustering groups users with similar behaviors or demographics, which can help suggest friends, target advertisements, or recommend content that might be relevant to specific groups of users.

Outlines

00:00

📊 Introduction to Clustering and its Marketing Application

Luis Serrano introduces clustering, an unsupervised learning method used for grouping data. He explains that the video will cover two key clustering algorithms: K-means clustering and hierarchical clustering. The example scenario is marketing, specifically customer segmentation for an app, where the goal is to develop three marketing strategies based on two factors: customer age (demographic) and engagement (behavioral). By plotting this data, Luis shows how distinct groups naturally emerge, leading to well-defined marketing strategies.

05:02

🍕 K-Means Clustering Explained with Pizza Parlor Example

Luis explains K-means clustering through a pizza parlor analogy. The algorithm works by randomly placing three initial 'pizza parlors' (centers) and assigning customers to their closest parlor. The algorithm then adjusts the parlors' locations based on the average location of their customers, repeating this process until the best positions for the parlors are found. The video emphasizes how the algorithm mimics human intuition, gradually improving through logical steps until the clusters stabilize.

10:02

📉 The Elbow Method: Determining the Optimal Number of Clusters

Luis introduces the elbow method, which helps determine the ideal number of clusters for K-means. By plotting the diameters of clusters for varying numbers of clusters, the method identifies the 'elbow' point where adding more clusters doesn't significantly improve the clustering. This graph-based technique balances computational efficiency and accuracy. While humans can easily see the elbow point, the method also accommodates high-dimensional data, keeping the graph in two dimensions for clarity.

15:04

🌳 Hierarchical Clustering Explained: From Simple to Complex Groups

Luis shifts to hierarchical clustering, explaining how it groups the closest points first and gradually merges them into larger clusters. The process starts with pairing the closest data points and progresses by joining the nearest groups. To visualize this, he introduces the concept of a dendrogram, a tree-like structure that helps in determining how many clusters to form based on distances between groups. Cutting the dendrogram at a specific distance yields the desired number of clusters.

📊 Dendrograms and Deciding the Number of Clusters

Expanding on hierarchical clustering, Luis explains how to use a dendrogram to decide where to 'cut' and determine the number of clusters. The process involves observing the distance between points or groups and using this information to form clusters at various levels of distance. The visual structure of the dendrogram makes it easy to decide where to stop merging clusters, offering both flexibility and insight, even with high-dimensional data.

🧬 Applications of Clustering in Biology and Social Networks

Luis concludes by highlighting real-world applications of clustering, particularly in genetics and social networks. In genetics, clustering helps in understanding evolutionary relationships by grouping species based on their genome. In social networks, clustering is used to group users with similar demographics or behavior, facilitating personalized content recommendations. He relates this back to how platforms like YouTube might recommend videos, illustrating the practical importance of clustering.

Mindmap

Keywords

💡Clustering

Clustering is a method of unsupervised learning where data points are grouped together based on similarity. In the video, clustering is applied to customer segmentation and marketing strategies. The core idea is to divide data into clusters so that data points in the same group are more similar to each other than to those in other groups.

💡K-Means Clustering

K-Means is a popular clustering algorithm that divides data into a predefined number of clusters (k). In the video, K-Means is illustrated using the analogy of placing pizza parlors in a city, where the algorithm works by iterating over random starting points and optimizing them based on the closest points in the data. The goal is to minimize the distance between points and their cluster center.

💡Hierarchical Clustering

Hierarchical clustering is another method of clustering that builds a hierarchy of clusters based on the proximity of data points. The video describes how hierarchical clustering works by repeatedly merging the closest pairs of points until a stopping criterion is met. The result can be visualized through a dendrogram, showing relationships between clusters at different levels.

💡Unsupervised Learning

Unsupervised learning refers to machine learning algorithms that work with unlabeled data. The algorithm tries to find hidden patterns without specific guidance on what the output should be. Clustering, as discussed in the video, is a type of unsupervised learning, where the algorithm autonomously discovers groupings in the data based on similarities.

💡Customer Segmentation

Customer segmentation involves dividing a customer base into distinct groups based on characteristics such as demographics or behavior. In the video, the goal is to segment customers into three groups based on their age and engagement with an app. This helps businesses create targeted marketing strategies for different customer segments.

💡Elbow Method

The elbow method is a technique used to determine the optimal number of clusters in K-Means clustering. The video explains that by plotting the number of clusters against the diameter of the clusters, a noticeable 'elbow' in the graph can help identify the point where adding more clusters no longer improves the model significantly.

💡Centroid

A centroid is the center of a cluster, representing the average position of all points within that cluster. In the K-Means algorithm, centroids are updated iteratively to minimize the distance between the data points and the centroid. The video uses the example of moving pizza parlors to the center of the areas they serve to explain how centroids work.

💡Dendrogram

A dendrogram is a tree-like diagram that shows the arrangement of clusters created by hierarchical clustering. It visually represents how data points are merged into clusters and at what distance. The video explains that cutting the dendrogram at different levels results in different numbers of clusters, which helps in deciding how many clusters to keep.

💡Distance Formula

The distance formula is used to calculate the distance between two points in a multi-dimensional space. In clustering algorithms like K-Means, the distance formula (such as Euclidean distance) helps determine which data points are closest to which centroid. The video emphasizes that this is how a computer decides which cluster a data point belongs to.

💡Behavioral Data

Behavioral data refers to information about how users interact with a product or service. In the video, engagement with an app (measured in days per week) is used as an example of behavioral data. This data, combined with demographic information (age), is used to cluster customers into meaningful groups for marketing purposes.

Highlights

Introduction to clustering as a type of unsupervised learning, focusing on grouping data based on similarity.

Application of clustering in marketing, particularly for customer segmentation to define three marketing strategies.

Key features used for customer segmentation: age (demographic) and engagement (behavioral) in days per week.

Visualizing data on a 2D plot (age vs engagement) makes it easier to see the three natural customer groups.

Introduction to k-means clustering and its analogy to placing pizza parlors in a city to serve clients based on their location.

Step-by-step explanation of how the k-means algorithm works, starting with random points and refining cluster centers iteratively.

Explanation of how computers determine the closest cluster for each data point using distance formulas.

Introduction of the 'elbow method' for determining the optimal number of clusters by analyzing the trade-off between number of clusters and data compactness.

Explanation of calculating the diameter of a cluster to measure the effectiveness of clustering solutions.

Challenges computers face in determining the right number of clusters and how the elbow method helps automate this decision.

Introduction to hierarchical clustering as an alternative method for grouping data, building clusters based on closest data points.

Demonstration of creating a dendrogram to visualize the merging process in hierarchical clustering.

Discussion of how to make decisions in hierarchical clustering, such as where to cut the dendrogram to form distinct groups.

Applications of clustering in real-world scenarios like genetics, evolutionary biology, and social networks.

Clustering methods are widely used in recommendation systems and social networks to group users with similar behavior for targeted content delivery.

Transcripts

play00:00

hello i'm luis serrano and this video is

play00:02

about flustering we're gonna learn two

play00:04

very important algorithms k-means

play00:07

clustering and hierarchical clustering

play00:09

clustering is a type of unsupervised

play00:12

learning and it basically consists of

play00:14

grouping data so if your data looks like

play00:16

it's all over the place the algorithm

play00:18

will say okay you got a group here

play00:20

you've got a group here a group here etc

play00:22

so let's take a look so let's start with

play00:25

an application the application is gonna

play00:26

be in marketing in particular and

play00:28

customer segmentation and the situation

play00:31

is the following we have an app and we

play00:33

want to market this app we've looked at

play00:36

our budget and we can actually make

play00:37

three marketing strategies so that's our

play00:39

goal to make three marketing strategies

play00:41

so the idea is to look at their

play00:43

potential customer base and to split it

play00:47

into three well-defined groups when we

play00:50

look at the customer base we realize

play00:52

that we have two types of information we

play00:55

have their age in years and we have

play00:58

their engagement with a certain page in

play01:00

number of days per week so one of the

play01:02

columns is demographic age and the other

play01:05

one is behavioral which is engagement

play01:06

with the page and the engagement on the

play01:10

page can be a number from 0 to 7 since

play01:12

it's in days per week

play01:13

so we look at the potential customer

play01:15

base and this is it there's 8 people

play01:18

with their age and their engagement so

play01:22

by looking at this list of people what

play01:24

groups can you come up with let's take a

play01:26

look feel free to pause the video and

play01:28

think about it for a minute so just by

play01:30

eyeballing I can think that for example

play01:32

this two people are similar they have

play01:35

similar ages and similar engagements

play01:37

maybe I could put those in the same

play01:38

group I don't know maybe these two are

play01:41

similar as well we can take awhile and

play01:43

we can actually write them down and

play01:45

maybe come up with groups but there's

play01:47

gotta be something easier or at least

play01:49

something mechanical the computer can do

play01:51

automatically so one of the first things

play01:55

to do with data is to plot it so let's

play01:57

let's plot it in some way let's plot it

play01:59

like this so in the horizontal axis we

play02:03

put the age and in the vertical axis we

play02:06

put the engagement and now it looks more

play02:09

clear right there are three groups here

play02:12

is one

play02:13

here is another one and here is the

play02:16

other one so that's our three marketing

play02:18

strategies the first one is for people

play02:21

around the age of 20 who are have a low

play02:24

engagement with the page two three and

play02:26

four days a week

play02:27

then strategy two for people that are

play02:30

around their late 30s and early 40s and

play02:33

high engagement with the page and then

play02:35

the last one is for people that are

play02:37

around their 50s and very low engagement

play02:39

with the page and that is pretty much

play02:41

for clustering is basically if our data

play02:43

looks like it's a bunch of points like

play02:45

this then a clustering algorithm will

play02:48

say hey you know what I don't know much

play02:50

about your data but I can tell you that

play02:52

it's kind of split into these groups so

play02:55

what we learn in this video is how to do

play02:58

these clustering how does the computer

play03:00

identify these groups because for a

play03:02

human in this small case it's easy but

play03:05

for computers not and in particular if

play03:07

you have many many many points and and

play03:10

many columns or many dimensions it's not

play03:12

easy so in this video I'm gonna show you

play03:14

two important methods the first one is

play03:17

called k-means clustering and the second

play03:19

one is called hierarchical clustering so

play03:22

let's start with k-means clustering and

play03:24

the question is how does the computer

play03:25

look at this points all over the place

play03:28

and figure out that they are forming

play03:30

these groups so when I try to imagine

play03:33

points in the plane I just imagine

play03:35

places in a city and trying to put pizza

play03:39

parlors so let's say that we are the

play03:41

owners of this pizza place and we want

play03:44

to put three pizza parlors in this city

play03:46

and what we want to do is we want to put

play03:50

them in such a way that we serve our

play03:51

clientele in the best possible way so we

play03:55

look at our clientele and it looks like

play03:57

this this is where they live so what we

play03:59

want to do is locate three pizza parlors

play04:02

in the best possible places that will

play04:04

serve a clientele so if you take a look

play04:06

at it you can come up with three places

play04:09

right it seems like we should have a red

play04:11

one that serves the red point some blue

play04:13

one that serves the blue points and a

play04:14

yellow one that serves the yellow points

play04:16

however for humans is easy but a

play04:18

computer has a harder time so what the

play04:21

computer is gonna do is like in most

play04:24

things in machine learning start a

play04:26

random spot

play04:27

and start getting better and better so

play04:28

how to start well first it locates three

play04:32

random points and puts three pizza

play04:34

parlors there and now what we're gonna

play04:37

do is a series of slightly obvious

play04:40

logical statements that when put

play04:43

together will get us to a better place

play04:45

so the first logical statement is it

play04:48

seems like if we have the pizza parlors

play04:50

in these places everyone should go to

play04:53

the closest one to them that makes sense

play04:55

right so we're gonna plot all the people

play04:59

that go to the red to the blue and to

play05:01

the yellow pizza parlor basically you go

play05:03

to the one that is the closest so here's

play05:07

another logical statement if all the red

play05:09

people go to the red pizza parlor it

play05:11

wouldn't make sense to put it in the

play05:14

center of all those houses right and the

play05:16

same thing with the blue and with the

play05:18

yellow basically you move the pizza

play05:20

parlor to the center of the houses that

play05:22

it's serving so the yellow one will

play05:24

serve these houses over here the blue

play05:27

one is serving these houses over here

play05:28

and the red one is serving these houses

play05:30

over here so we move each one of them to

play05:33

the center of the houses that they're

play05:34

serving and now let's apply the first

play05:37

logical statement again we have three

play05:40

pizza parlors and everyone's gonna go to

play05:43

the one that is closest to them so some

play05:45

things change right because let's take a

play05:47

look at these three blue points well now

play05:49

they're closer to the yellow pizza

play05:51

parlor so these people move and now

play05:54

they're gonna go to the other two the

play05:55

yellow pizza parlor

play05:56

what about these two red points over

play05:59

here well now they're closer to the blue

play06:01

pizza parlor so they're gonna start

play06:03

going to the blue pizza parlor now so

play06:06

let's go back to the ideological

play06:08

statement which is that the best

play06:10

location for a pizza parlor is the

play06:12

center of the houses that it serves so

play06:15

we move every pizza parlor to the center

play06:18

of the houses that it serves and again

play06:21

let's go back to the first logical

play06:22

statement which is every person goes to

play06:25

the closest pizza parlor so if you look

play06:28

at these points over here they are red

play06:30

but now they're much closer to the blue

play06:32

pizza parlor so they move to the blue

play06:33

pizza parlor now

play06:35

and you can see that we're getting

play06:36

better and better right because now when

play06:38

we apply the other statement which is

play06:40

every pizza parlor should be at the

play06:43

center of the houses that it serves then

play06:46

now we move everything to the center or

play06:47

the houses where it serves and we're

play06:49

done so that's pretty simple right and a

play06:52

computer can do it because a computer

play06:54

can find the center of a bunch of points

play06:57

by just averaging the coordinates and

play06:59

can also determine if a point is closer

play07:02

to one center than to the other one

play07:04

because it simply just applies the

play07:06

Pythagorean theorem or the distance

play07:07

formula and can compares numbers these

play07:09

are these are decisions that a computer

play07:11

can make very easily so we managed to

play07:14

think like a computer and not like a

play07:16

human which is basically the main idea

play07:18

and machine learning so this is a

play07:21

k-means clustering algorithm now you may

play07:25

be noticing that we took one decision

play07:27

that seemed to be taken by a human and

play07:29

not by a computer right we decided that

play07:31

there were three clusters but as we said

play07:34

that's hard for a computer to decide as

play07:36

a human can see it back empiric and so

play07:38

here's a question how do we know how

play07:40

many clusters to pick and for this we

play07:44

have a few methods but I'm gonna show

play07:45

you what's called the elbow method so

play07:48

the elbow method basically says try a

play07:50

bunch of numbers and then be a little

play07:52

smart on how to pick the best one

play07:54

so let's try with one cluster we can do

play07:56

this algorithm with only one cluster and

play07:58

we're probably gonna get something like

play07:59

this every house go to the same pizza

play08:01

parlor let me can run it with two

play08:03

clusters and you can start seeing that

play08:05

this algorithm actually depends on where

play08:07

the original point starts sometimes it

play08:09

works sometimes it doesn't sometimes

play08:10

give you different answers so let's say

play08:12

we try to clusters and we got this then

play08:14

we try three clusters and we got the

play08:16

solution that we got then we try with

play08:18

four clusters and let's say we got this

play08:20

with five clusters and we got this and

play08:23

with six clusters and we got this

play08:25

so by eyeballing this we can see that

play08:28

the best solution is with three clusters

play08:30

but again we need to teach the computer

play08:33

how to find the three clusters we need

play08:35

to think like a computer so we can't

play08:36

rationalize things we have to do things

play08:39

like measuring distances comparing

play08:41

numbers averaging coordinates etc so

play08:44

with those tools how do we find that 3

play08:48

is the

play08:49

best well what we need is a measure of

play08:52

how good is one clustering and maybe the

play08:57

following measure will make sense

play08:59

basically we're gonna do is we're gonna

play09:01

think of the diameter of a clustering

play09:03

and the diameter is simply gonna be the

play09:06

largest possible distance between two

play09:10

points of the same color that basically

play09:12

tells us how big each group is in a

play09:15

rough way so let's look at the first one

play09:18

cluster solution the longest possible

play09:22

distance between two points of the same

play09:24

color is this one those two red points

play09:27

are the farthest apart so that distances

play09:30

sign is a win away telling us how good

play09:32

is that clustering let's do it with two

play09:34

clusters so the longest distance let's

play09:37

say it's this distance over here that

play09:40

tells us how good the clustering is with

play09:42

two clusters now let's do it with three

play09:44

clusters let's say that the longest

play09:46

distance is this one over here again

play09:49

with four clusters along its distance is

play09:51

this one with five clusters long a

play09:54

distance is this one and with six

play09:56

clusters is this one now I just eyeball

play10:02

these distances so if you think there's

play10:03

another one you may be correct but

play10:05

conceptually what we're trying to do is

play10:07

to do it define the next method which is

play10:10

the elbow method so what we're gonna do

play10:12

is we take all these distances and we

play10:15

graph them in the following way on the

play10:19

horizontal axis we're gonna put the

play10:21

number of clusters so one two three four

play10:24

five and six and on the vertical axis

play10:26

we're gonna graph the diameter so we get

play10:29

the following points and now what we do

play10:32

is we join these points and now this is

play10:36

somewhere where a human can intervene a

play10:38

human can look at this graph and say

play10:40

okay you know what I want the elbow to

play10:41

be here there are also some automatic

play10:45

methods to do this but at some point in

play10:47

in the machine learning algorithm is

play10:49

good to actually have a consistency

play10:51

check because you may have an idea of

play10:54

how many clusters you want or you may

play10:56

have an idea of how many Coster you you

play10:57

would like to have or a maximum or a

play10:59

minimum so anyway in some way or another

play11:03

we figure out that the numbers to be

play11:05

another thing that's important is that

play11:07

this elbo math is very easy for a human

play11:10

if our if our data has many many columns

play11:14

we're looking at points in very high

play11:16

dimensions

play11:17

however the elbow method the graph is

play11:19

always gonna be two-dimensional so

play11:23

that's it that's how we decided that

play11:25

three clusters are the best and that is

play11:28

the k-means clustering algorithm in a

play11:30

nutshell okay so now let's go to our

play11:33

second method which is hierarchical

play11:34

clustering and we're gonna do a similar

play11:36

problem except now with this data set

play11:38

we're gonna find it a clustering and two

play11:41

let's see how many groups we can find so

play11:44

another way to do it is the following

play11:45

let's think about this let's think of

play11:48

the two closest points it wouldn't make

play11:51

sense to say that these two points that

play11:53

are the closest would belong to the same

play11:55

group maybe yes maybe no but it's a

play11:57

sensical thing to ask right so let's go

play12:00

on that statement let's say these are

play12:02

the two closest points so these two are

play12:05

gonna be part of the same group now what

play12:08

are the next two closest points let's

play12:10

say it is two so these two belong in a

play12:12

group and we're gonna keep going in this

play12:14

direction the two closest points are

play12:16

these ones so these two belong to the

play12:18

same group the two closest points are

play12:20

this ones so now what do we do well we

play12:23

just join the two groups so now it

play12:25

becomes a group of three the two closest

play12:27

points are these two so they join like

play12:30

this the two closest points after that

play12:32

are these two so we join the two groups

play12:34

the group of two and the group of three

play12:36

into a group of five and then the next

play12:39

pair of points are the closest are these

play12:41

- so we're gonna join them but let's say

play12:43

that's just too big so we have maybe a

play12:45

measure of how much is too far so we

play12:48

stop here and that's it that's

play12:51

hierarchical clustering it's pretty

play12:52

simple right now again there seem to be

play12:55

a human decision here right why did we

play12:58

decide on that being the distance or for

play13:00

example why did we decide on two being

play13:02

the number of clusters so we can make

play13:04

this decision but let's actually look at

play13:06

an educated way to make this decision so

play13:08

let's answer this question how do we

play13:09

decide the distance or the number of

play13:12

clusters so a way to do it is by

play13:14

building something called add and drop

play13:16

so what we're gonna do is the following

play13:19

we're gonna pour points in a row over

play13:21

here one up to eight and then in the

play13:24

vertical axis we're gonna graph the

play13:26

distance I'm going to show you how let's

play13:29

pick the closest two points which are

play13:31

four and five so we join four and five

play13:33

and we join them over here and this is

play13:37

not up to scale but the height of that

play13:40

little curved line between four and five

play13:42

let's say is the distance between four

play13:44

and five so we join this two and then we

play13:47

go to the next two which is 1/2 and so

play13:50

we're going to join one two here and

play13:53

we're gonna join them in the dendrogram

play13:55

they're right and again assume that that

play13:57

height of that little curved line is the

play14:00

distance between one and two now we join

play14:03

the next pair which is six and seven so

play14:05

we join six and seven and again the

play14:06

height is the distance we keep going six

play14:09

and eight

play14:10

so now we're gonna join six and eight

play14:11

how do we join them well we join them

play14:14

like this the group of six seven and the

play14:17

group of eight and the next group is

play14:20

three and four five so they get joined

play14:24

like this and now the next group is

play14:27

gonna be two and three so we join the

play14:29

group corresponding to two one the

play14:30

group's one two three in the dendrogram

play14:31

and notice that the dendogram goes up

play14:34

because these distances increase so

play14:37

every time we make a new joint it's

play14:39

higher than the previous one the next

play14:42

one that we joined are three and six so

play14:44

we end up joining these two trees like

play14:48

that and so that's it we have a lot of

play14:51

information about this set in this

play14:52

dendrogram and now how do we decide

play14:55

where to cut well let's say we cut over

play14:58

here at a certain distance and that

play15:01

gives us two clusters which are this one

play15:03

one two three four and five and this one

play15:06

which is six seven and eight so notice

play15:08

that we made the decision on cutting

play15:10

based on how much a distance is too far

play15:13

away or how many clusters do we want to

play15:15

obtain let's say the one obtained four

play15:17

clusters so we cut out this distance

play15:19

over here which gives us four clusters

play15:21

the cluster formed by one and two the

play15:24

one formed by three by itself the more

play15:26

informed by four and five and the one

play15:28

formed by six seven and eight so again

play15:31

these decisions are taken by a human but

play15:33

think about it again

play15:33

let's say we have billions of points and

play15:36

let's say that they live in a thousand

play15:39

dimensional space it doesn't matter the

play15:41

dendogram is still a two dimensional

play15:43

figure and we can easily make decisions

play15:46

on it so again a combination of a

play15:48

computer algorithm and some smart human

play15:50

decisions it what gives us the best

play15:52

clustering and that's it

play15:55

that's hierarchical clustering in a

play15:56

nutshell clustering has some very

play15:59

interesting applications and admissions

play16:01

some of them things like genetics or

play16:03

evolutionary biology the genome carries

play16:06

a lot of information about a species and

play16:08

if you manage to cluster them you get to

play16:10

understand a lot about species and how

play16:13

they evolved into what they are right

play16:14

now

play16:15

other things I recommend are systems use

play16:17

a lot of clustering for example the way

play16:20

you may have got this video recommended

play16:21

was using several methods that include

play16:24

clustering users grouping them into into

play16:27

similar users so maybe somebody very

play16:29

similar then you watch this video and

play16:32

that's why you gotta recommend it and

play16:34

that brings us to social networks which

play16:36

is another place where a clustering is

play16:38

used a lot in a very similar example

play16:40

than the one we did social networks use

play16:43

these methods to group users into

play16:45

certain similar groups based on

play16:47

demographics based on behavior and then

play16:50

be able to target information to them

play16:52

that they want to see or suggest your

play16:55

friends that are similar to you at

play16:56

cetera so that's all for now thank you

play16:58

very much for your attention as usual if

play17:01

you would like to see some more of this

play17:03

content please subscribe or hit like

play17:05

feel free share with your friends and

play17:07

feel free to throw in a comment and tell

play17:10

me what you think of the video or if you

play17:11

have any suggestions for other videos

play17:13

you'd like to see and my twitter handle

play17:15

is Luis likes math if you'd like to

play17:17

tweet at me so thanks again and see you

play17:20

in the next video

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
ClusteringK-meansHierarchicalMachine LearningData ScienceMarketingCustomer SegmentationAlgorithmsUnsupervised LearningData Visualization
Benötigen Sie eine Zusammenfassung auf Englisch?