What I'll just describe it suppose you have pc-1 pc2 and pc 3 pc 4 right suppose we have 4 features to start with and we ended up with 4 pcs and the values of SSD is you know say 26 3 1 usually you know as you increase when you go from pc1 towards the higher dimension the SSDs will reduce as this will reduce because that's the maximum they try to capture in PC 1 itself right so what we do is basically if you add them up it is the third total is 30 that means this is about 67% of the variance and this is about 20% right and this is about 10% and this is about 3% right so that's how the different a very different specie captures different variants.

So you might decide an hour to cap you know keep about 85% or 90% if you keep if you want to keep 85% of your information then you can keep just pc1 & pc2 and let go of PC 3 and PC for so that that way you get down to 2 dimensions if you want to capture 90% or more then you keep pc-1 pc2 and pc 3 and the pc 4 can be thrown away right because it captures only 3% of the information you still keep 97%, in this case, this is just a made-up example when we look at an example it actually we see one usually does even better it goes very very high right with all that rotation it goes very very high right so now so this is I mean this is a so we can calculate the new values of our data points in terms of pc1 & pc2 and we can this becomes our new graph a new demand you know essentially this is how the data will look like after we have turned it into our principal components right.

So the idea is to capture the maximum information in the data in PC 1 and then draw a perpendicular line to it to capture it in PC 2 then another perpendicular line for to both pc1 & pc2 to get BC 3 and then so on B basically so what is this perpendicular thing is what does perpendicular means in this case perpendicular will mean is basically these are these features the pc-1 pc2 are independent basic is not correlated they come they're very independent right and some of Simon you have learned about like how correlation can sometimes create a problem so we are basically avoiding that here is you are basically creating completely independent features because you're going straight up in ninety percent ninety-degree right so that's the idea behind principal component analysis where we build.

So what do we basically build new features combining existing features we also understand how much variance or information is captured by each of these new features and depending on our judgment we can throw away some of the PCs to reduce the dimension of our data we can still yes okay yes so how we can do perpendicular Nets okay so let's look at this one right so here suppose we say it's a like it but you know F 1 is 3 and F 2 is 1.5 that's what we saw right similarly if you take a point here I mean we can basically when perpendicular saying that it's you know you know this becomes minus right this FF 1 will be minus 3 right here you can if it's just you know you are basically coming up with the new coordinates which are minute opposite to it it's very easy yeah so like if F 1 and F 2 are 3 and 1.5 right what will be the perpendicular of it if you look at this I mean you know and if I see draw a point here it will be minus 1.5 and 3.

So and 1 minus 1.5 is perpendicular to three and 1.5 okay so that is that will not qualify for people to be called as pc3 with every PC again we are just talking about lines here because we are just dealing with two-dimensional data we might be dealing with the 100 dimension that means how each PC will be a plane and each PC will be 90 degrees to the all other pcs not just to the immediate 100 other pieces no-no PC one will remain fixed we calculate PC two because if it's fixed we know how to draw a right angle on this once with one these two are fixed we know how to draw another angle at it then we draw another angle on all three of them perpendicular so every PC will be perpendicular to each other not to some just one or two so let me get so right yes it will come out to be zero all of them that's it that they come they are independent features there they are built like that no.

Basically what we are doing is we are see and so what we will do we will basically multiply this you know this is a multiply the original data back one and one feature one with one feature two with 0.5 to calculate the new value similarly for it so the PC to be multiplied by 1 and a minus 0.5 to get the next value so we are not so after we calculate pcs we don't really care about the original data we are going to use the PCs to feed it to the Machine to learn you learn from the data we are reducing the dimensions and also at the same time we are trying to capture as much information as possible in the original data right right right right so yes so PC I mean you know once we do PC one we can easily get all pcs we can easily get all pieces because it's just a projection then it is not dependent on data anymore the underlying data it's all projection on PC 1 and then PC 2 and then pc 3 and PC for at that point we are not really looking at our underlying data right because once you have PC one only for PC one we look at the data after that it's all perpendicular to the PC one.

Yeah, you can convert it back 200 because you know how PC 1 was built it used a 1:1 ratio of 1 with the first feature point with 0.5 with the second feature so you can go back to the but having said that because you have thrown out some of the pcs you may not be able to capture your data completely right if you threw out some pcs so that what that means is you will not capture that values of you know 200% vector and I came back yes is each where each PC will have unique eigenvector and eigenvalue yeah and not really only PC one gets rotated only what the first line gets rotated to get PC one once PC one is there then we just draw a line something we don't really care about the underlying data because we have found that line on which we have to base all our new pcs yes to be ready to feature in this example.

We are just drawing a perpendicular line and how do I get the new features so how do I get the new feature let's look at that is for PC one I project so I get these values right for PC when I get so these values are nothing but this distances are nothing but the PC one for me for the new data for the existing data I get me to see one this is my PC one for first this data point this is my PC one for second data point this is my PC one for third data point right now how do I get PC to again I what I will do I will project my data on PC too so now this you can see that very it's very near to you know origin but even this becomes my PC - for this becomes my PC - for this or this I mean depending on but which one we projected but again here also be a project we project each point on every PC to get the new value yes yes what is pc2 doing there what we let's go back to the baseline what happens is PC one captures the maximum variance but not 100% of it.

Post a Comment

Previous Post Next Post