8.2 Clustering | What is clustering? -- [Machine Learning | Andrew Ng]
 What is clustering? A clustering algorithm looks at a number of data points and automatically finds data points that are related or similar to each other. Let's take a look at what that means. Let me contrast clustering, which is an unsupervised learning algorithm, with what you had previously seen with supervised learning for binary classification. Given a data set like this with features x1 and x2, with supervised learning we had a training set with both the input features x as well as the labels y, and we could plot a data set like this and fit, say, a logistic regression algorithm or a neural network to learn a decision boundary like that. And in supervised learning, the data set included both the inputs x as well as the target outputs y. In contrast, in unsupervised learning, you're given a data set like this with just x, but not the labels or the target labels y. And that's why when I plot the data set, it looks like this, with just dots rather than two classes denoted by the x's and the o's. Since we don't have target labels y, we're not able to tell the algorithm what is the quote, right answer, why that we wanted to predict. Instead, we're going to ask the algorithm to find something interesting about the data, that is to find some interesting structure about this data. But the first unsupervised learning algorithm that you learn about is called a clustering algorithm, which looks for one particular type of structure in the data. Namely, it'll look at the data set like this and try to see if it can be grouped into clusters, meaning groups of points that are similar to each other. So a clustering algorithm in this case might find that this data set comprises of data from two clusters shown here. Here are some applications of clustering. In the first week of the first course, you heard me talk about grouping similar news articles together, like the story about pandas or market segmentation, where at deeplearning.ai we discovered that there are many learners that come here because you may want to grow your skills or develop your careers or stay updated with AI and understand how it affects your field of work. And we want to help everyone with any of these goals to learn about machine learning. Or if you don't fall into one of these clusters, that's totally fine too. And I hope deeplearning.ai and Stanford Online's materials will be useful to you as well. Clustering has also been used to analyze DNA data, where you would look at the genetic expression data from different individuals and try to group them into people that exhibit similar traits. I find astronomy and space and space exploration fascinating. And so one application that I thought was very exciting was astronomers using clustering for astronomical data analysis to group bodies in space together for their own analysis of what's going on in space. And so one of the applications I found fascinating was astronomers using clustering to group bodies together to figure out which ones form one galaxy or which one form coherent structures in space. So clustering today is used for all of these applications and many, many more. In the next video, let's take a look at the most commonly used clustering algorithm called the Key Means algorithm. And let's take a look at how it works.
[{"start": 0.0, "end": 3.7600000000000002, "text": " What is clustering?"}, {"start": 3.7600000000000002, "end": 9.68, "text": " A clustering algorithm looks at a number of data points and automatically finds data points"}, {"start": 9.68, "end": 12.68, "text": " that are related or similar to each other."}, {"start": 12.68, "end": 15.44, "text": " Let's take a look at what that means."}, {"start": 15.44, "end": 21.400000000000002, "text": " Let me contrast clustering, which is an unsupervised learning algorithm, with what you had previously"}, {"start": 21.400000000000002, "end": 25.240000000000002, "text": " seen with supervised learning for binary classification."}, {"start": 25.24, "end": 35.2, "text": " Given a data set like this with features x1 and x2, with supervised learning we had a"}, {"start": 35.2, "end": 42.32, "text": " training set with both the input features x as well as the labels y, and we could plot"}, {"start": 42.32, "end": 48.16, "text": " a data set like this and fit, say, a logistic regression algorithm or a neural network to"}, {"start": 48.16, "end": 51.32, "text": " learn a decision boundary like that."}, {"start": 51.32, "end": 57.04, "text": " And in supervised learning, the data set included both the inputs x as well as the target outputs"}, {"start": 57.04, "end": 58.6, "text": " y."}, {"start": 58.6, "end": 65.44, "text": " In contrast, in unsupervised learning, you're given a data set like this with just x, but"}, {"start": 65.44, "end": 69.03999999999999, "text": " not the labels or the target labels y."}, {"start": 69.03999999999999, "end": 74.68, "text": " And that's why when I plot the data set, it looks like this, with just dots rather than"}, {"start": 74.68, "end": 79.72, "text": " two classes denoted by the x's and the o's."}, {"start": 79.72, "end": 85.52, "text": " Since we don't have target labels y, we're not able to tell the algorithm what is the"}, {"start": 85.52, "end": 89.8, "text": " quote, right answer, why that we wanted to predict."}, {"start": 89.8, "end": 95.4, "text": " Instead, we're going to ask the algorithm to find something interesting about the data,"}, {"start": 95.4, "end": 99.44, "text": " that is to find some interesting structure about this data."}, {"start": 99.44, "end": 105.44, "text": " But the first unsupervised learning algorithm that you learn about is called a clustering"}, {"start": 105.44, "end": 110.28, "text": " algorithm, which looks for one particular type of structure in the data."}, {"start": 110.28, "end": 118.2, "text": " Namely, it'll look at the data set like this and try to see if it can be grouped into clusters,"}, {"start": 118.2, "end": 122.03999999999999, "text": " meaning groups of points that are similar to each other."}, {"start": 122.03999999999999, "end": 127.68, "text": " So a clustering algorithm in this case might find that this data set comprises of data"}, {"start": 127.68, "end": 130.24, "text": " from two clusters shown here."}, {"start": 130.24, "end": 133.07999999999998, "text": " Here are some applications of clustering."}, {"start": 133.08, "end": 138.56, "text": " In the first week of the first course, you heard me talk about grouping similar news"}, {"start": 138.56, "end": 147.0, "text": " articles together, like the story about pandas or market segmentation, where at deeplearning.ai"}, {"start": 147.0, "end": 152.68, "text": " we discovered that there are many learners that come here because you may want to grow"}, {"start": 152.68, "end": 160.56, "text": " your skills or develop your careers or stay updated with AI and understand how it affects"}, {"start": 160.56, "end": 162.32000000000002, "text": " your field of work."}, {"start": 162.32, "end": 169.68, "text": " And we want to help everyone with any of these goals to learn about machine learning."}, {"start": 169.68, "end": 173.56, "text": " Or if you don't fall into one of these clusters, that's totally fine too."}, {"start": 173.56, "end": 180.28, "text": " And I hope deeplearning.ai and Stanford Online's materials will be useful to you as well."}, {"start": 180.28, "end": 186.88, "text": " Clustering has also been used to analyze DNA data, where you would look at the genetic"}, {"start": 186.88, "end": 193.56, "text": " expression data from different individuals and try to group them into people that exhibit"}, {"start": 193.56, "end": 195.96, "text": " similar traits."}, {"start": 195.96, "end": 201.79999999999998, "text": " I find astronomy and space and space exploration fascinating."}, {"start": 201.79999999999998, "end": 208.46, "text": " And so one application that I thought was very exciting was astronomers using clustering"}, {"start": 208.46, "end": 215.24, "text": " for astronomical data analysis to group bodies in space together for their own analysis of"}, {"start": 215.24, "end": 218.16, "text": " what's going on in space."}, {"start": 218.16, "end": 225.70000000000002, "text": " And so one of the applications I found fascinating was astronomers using clustering to group"}, {"start": 225.70000000000002, "end": 234.16000000000003, "text": " bodies together to figure out which ones form one galaxy or which one form coherent structures"}, {"start": 234.16000000000003, "end": 236.16000000000003, "text": " in space."}, {"start": 236.16000000000003, "end": 242.74, "text": " So clustering today is used for all of these applications and many, many more."}, {"start": 242.74, "end": 248.16, "text": " In the next video, let's take a look at the most commonly used clustering algorithm called"}, {"start": 248.16, "end": 249.88, "text": " the Key Means algorithm."}, {"start": 249.88, "end": 272.84, "text": " And let's take a look at how it works."}]