Hello folks, this is a pretty simple example, a lesson of a few simple examples from the Harrington book and we will just have some screenshots and a few comments. We should get through this pretty quickly. This is your instructor Jeffrey Fox in machine learning and cloud services. Part one came in clustering in April 2019 and then we first look at t-shirts. Just wanted and we're trying to design how many sizes we want and we try to do that by clustering weight versus some height of clients and we can look at various many clusters and there is a python code which works up to plotting five clusters and here we have this map plot level course and here we have two clusters, two t-shirt sizes and here's the first cluster and here's the second cluster and these are the centers which we should be aiming at. Here is height and inches, here is weight and milligrams or what have you maybe not milligrams and here we have three clusters. We've managed to slip in a blue cluster in the middle of the two other clusters actually pretty similar. So we can have three sets sizes, a large medium small or so on so that's actually not so many. You usually have more sizes than that and here's a second example coming from dating rating with their free feet which you rate people on. A thousand points and the categories have been assigned by the users to the points and here is the specification of where you get all this stuff from. It's online and we compare laboring a point from people with new clustering which uses my favorite advanced method using so called deterministic annealing but I don't think for this problem it matters what you use because the clusters aren't very clean and the new clustering has the centers marked. The old clustering are just labeled by color of points and then we have side by side pictures of the user clustering and the machine clustering and the 3D data is projected in different ways to 2D. There we are. Here we have the original user labels over here. Here we have the k-means. Well in this projection that looks so similar do they. In fact they're totally different because this one is done in stripes across in vertical stripes. Sorry horizontal stripes and this one is done actually just in blobs. So that's well I mean that's just inevitable. There's no clean structure in this problem so when you're doing dating it says with these features you're going to just be able to find dates which are similar to other dates not ones that are dramatically clearly associated to your tastes. Here we are. This is the same data but just rotated. Now the original labels are pretty clean and the machine plotting, by the way notice that the machine generated data clustering has centers so you can see the centers of the labels. Another one and that's it. Now we can do the same data we can do more clusters. We have three clusters which is what we have before or 28. 28 should have been 30 but in these fancy clustering programs sometimes cluster you start with 30 but then some of them disappear because during the iteration the number of points in the clusters goes to zero. I noted that and when I discussed that we could be there example we could have chosen some initial conditions where there were zero points in the clustering. And the key point is which we'll keep on emphasizing clustering always takes your big space and divides it into subspaces and that is often all you need. You don't actually need to have clean clusters and here we have a let's say here we have our machine clustering into three and we have these three blobs. That's what we saw before and here is a rotation still three glasps but differently. Here we have 28 clusters so here in the centers you can see there's still blobs but these blobs are compact and much smaller and size than the previous blobs. That's what you expect if you divide the world into 28 parts there's parts of be smaller than if you divide into three parts. And here we have another view of the 28 cluster solution which are essentially the same information. So