Complete Playlist of Unsupervised Machine Learning https://www.youtube.com/playlist?list=PLfQLfkzgFi7azUjaXuU0jTqg03kD-ZbUz

I hope you enjoyed the videos on how you can build your own recommender system. Before we wrap up this week in this and a few other optional videos I'd like to share with you an unsupervised learning algorithm called principal components analysis. Let's look at Basics of Principle Component Analysis with Example and Introduction of Principle Component Analysis. This is an algorithm that is commonly used for visualization. Specifically, if you have a dataset with a lot of features, say 10 features or 50 features or even thousands of features, you can't plot 1,000 dimensional data. PCA, or principal components analysis is an algorithm that lets you take data with a lot of features, 50, 1,000, even more, and reduce the number of features to two features, maybe three features, so that you can plot it and visualize it. Is commonly used by data scientists to visualize the data, to figure out what might be going on. Let's take a look at how PCA, principal components analysis works. To describe PCA, I'm going to use as a running example, if you have data from a collection of passenger cars, and passenger cars can have a lot of features. You may know the length of the car or the width of the car, maybe the diameter of the wheel, or maybe the height of the car, and many other features of cars. If you want to reduce the number of features so you can visualize it, how can you use PCA to do so? For the first example, let's say you're given a dataset with two features. The feature x_1 is the length of the car, like so, and the second feature x_2, is the width of the car, which is measured like so. It turns out that in most countries, because of constraints about the width of the road the cars drive on, width of the car which has got to fit within the width of the road of a single lane, tends not to vary that much. For example, in the United States, most cars are, let's call it about 1.8 meters wide, that's just under six feet. If you were to have a collection of cars and the dataset of the length and width of the cars, you will find that the dataset might look like this, where x_1 varies quite a bit because some cars are really long and x_2 varies relatively little. If you want to reduce the number of features, well, one thing you could do is let us take x_1 because x_2 varies relatively little from car to car. It turns out that PCA is an algorithm that when applied to this data set will more or less automatically decide to just take x_1, but it can do much more than that. Let's look at a second example where here x_1 is again the length of the car, and let's say that in this dataset, x_2 is the diameter of the wheel. The diameter of the wheel does vary a little bit. If you were to plot the data, it might look like this. But again, if you want to simplify this dataset to just one feature, you might decide, let's just take x_1 and forget x_2 and PCA when applied to this dataset. Well, again, more or less, cause you to just check the feature x_1. In both the examples we saw, only one of the two features seemed to have a meaningful degree of variation. Here's a more complex example. Say the feature x_1 is the length of the car, so that varies quite a bit, and the feature x_2 here is the height of the car, which also varies quite a bit. Some cars are much taller than other cars. If you were to plot the data, you might get a dataset that looks like this, where some cars are bigger and they tend to be longer and taller, and some cars are a little bit smaller. They tend to be not as long and not as tall. If you wanted to reduce the number of features, what should you pick? You don't want to pick just x_1, the length, and ignore x_2 the height and you also don't want to pick just x_2, the height, and ignore x_1, the length. It seems as if both x_1 and x_2 have useful information. In this graph, x_1 and x_2 are the two axes of this plot. Instead of being limited to taking either the x_1 axis or the x_2 axis, what if we had a third axis. I'm going to call this new axis the z-axis. To be clear, this is not sticking out of this diagram. This is a combination of x_1 and x_2. This is not a z-axis that's sticking out in the third dimension. This z-axis lies flat within this plot. But why do we have the z-axis which corresponds to something about the size of the car? Given a car like this one over here, its coordinate, meaning the value on the x-axis tells us the length of the car and the coordinate is just, what is this distance? Similarly its coordinate, meaning, what is this distance on the x_2 axis tells us what is the height of the car. If we're now going to use the z-axis instead as one feature to capture what we know about this car then is coordinate on the z-axis, meaning this distance.

Subscribe to our channel for more computer science related tutorials| https://www.youtube.com/@learnwithgeeks