1. Home
  2. Explore
  3. Mathematics
  4. Regression Analysis Overview

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Regression Analysis Overview

Transcript

regression analysis That's all about data It helps businesses understand the data points they have and use them specifically relationships between data points to make better decisions including anything from predicting sales to understanding inventory levels and supply and demand Understanding this we have coming for this regression analysis tutorial Now before we go ahead with this session I'd like to inform your life that we have launched a completely free platform going Greek Learning Academy But you have access to free courses such as the iCloud Investors marketing You can check out the details in the description below Now let's are quick glance of the agenda They will start off with linear regression algorithm Then we will learn about the logistic regression algorithm So let's start off of this case study Now let's say you are conducting a survey on a bunch of college students on You'd want to understand if

there's a relationship between those CDP off the student and his or her g r E Score Now the problem statement is basically this So you were understand of the students who have ah higher CDP on certain to have a higher G I t score and similarly If students have a lower CDP then would they have a lower grt score Is the problem statement now To find out the solution for any problem you need to gather data So that is what you go ahead and do So let's say you go to around 500 odd students on ask them their jihadi score and also ask them the CDP and then you create a table out of this But if you just look at the stable would you be able to draw any sort of inferences from this Obviously no So this is where you do some sort of data Visualisation So or here You've got this jihadi score and you've got this CDPF Now what do you do Issue will map the g r E score onto the Y axis and you'll map the CDP onto the X axis and you'll build a scatter plot for these

two on As soon as you build this graph you can clearly draw inferences So what you understand us As the CDP off the student increases the G R E school off the student would also increase So they're sort off a positively new relationship between the cdp of the student and the jihadi score off the student So with this you can clearly state that if a student has high cdp then he'll have Ah hi Jerry Score Similarly if the student has a low CDP then Hill sort of have a Luigi Ari score Now this inference was quite easy to draw from this visualization Now what if I actually change the question So let's say if I ask what will be the Grt scored off a student if his c g P s 8.32 now if you just look at this graph or here on def I see that the CD piece 8.32 would be actually a bill to tell what Toby is Johnny score Now that would be difficult And this is exactly where regression analysis comes in So let's understand what exactly it's regression analysis So as

it has stated over here regression analysis basically helps us to understand the relationship between two or more variables by creating a predictive model Now this simply means that you have a dependent variable and you have the independent variable So as we saw in the previous graph we had mapped the jihadi scored onto the Y axis and the CDP onto the X axis But when it comes to regression analysis will do something different So in regression analysis you basically have a dependent variable on one or more independent variables Now we will map this G R E score as our dependent variable and will map the CDP as our independent variable And we will try to understand How would the Grt score very with respect to the CDP Or in other words we obviously trying to understand How would the dependent variable change with respect to the independent variable Now since we already know the value of CDP which was equal to 8.32 so I

would have to take this value off CDP plug it into the X variable and then I'll get the value off White with his out regression analysis works now the simplest category off regression analysis IHS Lena Regression where we basically try to understand the lean your relationship between the dependent variable and one or more independent variables and the important thing to note in linear regression ist your dependent variable needs to be a continuous numerical value so And this is what we have with respect to what problem Statement So over here Jari score is our dependent variable which is a continuous numerical value And we are trying to understand how does it change with respect to the CDP off the student which would be our independent variable And when it comes to linear regression we basically have a street line So a straight line is a linear equation And that is why this algorithm is known as lean your regression So we have why and

we're trying to understand how does why very with eggs So this be what you see So this is the coefficient off X and this is basically this loop off the line And this a what You see this is the intercept off the line on the Y axis Now let's accept this concept Tofino regression to the previous problem statement So we had the jihadi school of the student map to the Y axis and we had the CDP off the student map to the X axis Now we know the CDP of the syringe was 8.32 So let's see if this value

here is 8.32 Then the corresponding value off the G R E score of the student would be around 308 all 309 But the question over here which and Isis How do you know that this is the best fit Like now let's see if I draw another line like this on the CCP of the student is again 8.32 So for this value off 8.3 to the G r E School of the student could be something girls So this time the Grt score could be around 312 or three Island 13 So as you see when it seems the equation off the

line over here the value off Why also changes Let's say I draw another line like this So again the value off excess seam But the value off by will change So this time though Grt scored would be around 305 Now similarly we could have a million Are the lines passing through the's selloff points So party know which is the best fit line right So to understand that will take this example here So there is something less measure off good fit Now instead of taking all of those points will just take the

selloff six points forward here and I'll start by drawing an arbitrary line over here now these green points which you see So these are the actual observed values for the value off X So when the value off excess equal due to the observed value off by this five But then again the value which is being predicted by this line would be around 2.2 So there difference between this observed value off my and their predictive value off by by this line is what is known

as the residual or the editor in prediction And similarly you'll have a residual for all of these points over here Let's take this point now here the X value is equal to two and the observed value off by s four But the predictive value off Why would be around 3.8 Similarly if you take this point X value is four and the observed value off by a stoop But the predictor value off by over here is five And if we take this point X value is five absorbed value off why seven and the prick their value off wires around the 6.5 right to these dotted red lines Would you see these basically indicate the residuals Although editor in production and get that best fit line don't you agree that we would basically have to reduce these individuals as much as possible And this world we have something no other residual some off square So what we do is will go to this first residual and will square this up Then we'll go over this second residual will square this up

go to the third residual and then will square this up and we'll do this for all of the residuals And then we'll take the summer off all of the residuals Now when we take the sum this has to be as Lewis possible And whichever line would have the bluest value off residual some more squares that would be the best fit line Now let's extend this concept of the previous problem statement So this was our problem statement where the Grt School was on the Y axis and the cdp of the student was under X axis And we've got these three lines over here So for the first line the residual sum of squares comes to be around 28 For the second line the stool for most squares comes to be around 22 And for the third line though this dual samo squares comes to be 24 Now when we compare all of these three residual sum of squares the second line would be the best fit line for our problem statement So now we've got the best fit line on We only know that or linear Line would

have an e question associated with it which is basically by equals MX plus C And that is the question or here So here why is basically the Grt School of the Student on X is the CDP off the student and these two which you see the n value and the C value this we've got from the best fit line So the M value which is the slope of the line comes to be around 6.8 and the Y intercept comes to be to 61 now to get the Grt School of the Student all we have to do with black in the CDP off the student which we already know so will plug in 8.32 into this equation and will get a final value off 317 So this is how you were able to get the Grt score off the student by just knowing the CDP off the student And this is how linear regression algorithm books

Now that was a simple linear regression where we had one dependent variable and just one independent variable I will extend this concept into something Yunus Multiple linear regression So in multiple linear regression will have multiple independent variables instead of just one independent variable So to understand Dr Will take this day does it a war here So this is the famous empty cars D does it that we have these columns So this is the MPG column Then we've got the weight of the car the horse part of the car the number of cylinders in the car in the number of girls in the cars And we want to understand how does the mileage off the car very with respect to all of these other independent fee edibles And since mileage is our dependent variable will denote it with y and all of the other independent variables would be denoted like this So wait I'm denoting it with x one horse par with X two number of cylinders with X three and number of girls with X four And this is

the final equation off this hyper playing over here so we'll type in Why equals x one plus b x two plus e x three plus d Export Place E And this would be the equation off the hyper plane So implemented renewed aggression algorithm will be walking with this Diamond Sutra Sit on Let's have a glance of the description of this data set so the studio said comprise off 10 columns and there are 53,940 does Or in other words there are 53,940 diamonds So we've got the price column which basically notes the price of the diamond and US dollars Then we've got carried which denotes the weight of the diamond Then we've got God which is for the quality of the cut You've got all of these different columns over here Then we've got X y and zed which basically you know the length of the diamond the birth of the diamond and the depth of the diamond and millimeters Right now before we go ahead and start of by implementing the

linear regression algorithm let's do some data manipulation on dinar visualization and let's understand the street as it properly So while start by looking at the structure of the state as it and to look at the structure of the data set I use this str command And inside this ill passengers does it which is diamonds So I'll type and diamonds over here Right So these are all of the columns over here So you see that characters on your medical column and then we've got cut color and quality which are factors Then again we've got on your medical columns over here right So this is the structure of this So we saw the structure of the data set Now we'll go ahead and perform some data manipulation operations So let's say I wanted on your subsidy off this entire day does it where the cut off the diamond is equal to premium on The price is greater than $5000 So for that I'll be using Go to ply package So let me load of the diplomatic Ege so I'll type in

library off the Flyer Onda We've got the filter function from the deploy package so I'll started by giving the name of the data set which is diamonds on Then I use this pipe operator Now this pipe operator is used to connect different objects and functions together So with the help of this pipe operator I am connecting this diamonds date asset with the filter function and inside the filter function I'll give in my conditions so the first condition would be the cut off The diamond needs to be equal do premium so I'll type in premium over here and then I'll give in The second condition which is the price of the diamond needs to be greater than 5000 So I'll said the condition which is priced is greater than 5000 And I also this in our new day does it on the metas Let's see premium price Let me have a glance of this So have a glance of the data said I'll be using the view function And inside this I've given the name of the deal aside which

is premium price right So are of those 53,000 diamonds We have extracted only 4717 entries where the cart off the diamond is equal to premium and the price of the diamond is greater than $5000 Right If you look at these two columns closely then you see that in the CART column The value is only premium and in the price column it is greater than $5000 now Similarly let's do some other operations Now let's say I want the length off their diamond to be greater

than four millimeters So let's go ahead and given that command again I will start a bag during the name off the data set After that I will use the five operator and then use the filter function andare Inside this I'll get the condition so X needs to be greater than four I'll store this and diamonds on the score length Now I'll have a glance of this view off diamonds length So as you see over here if you check this length column which is X you see that the land is greater than

four millimeters so these were some basic data manipulation operations Now we'll go ahead then perform some data visualization operations using the G plot to package So I loaded 30 deployed to package I'll type in library off cheesy plot to over here Now this data said BC which I'm looking with their diamonds Yes it is also part of the DJ plot to package So if you want to implement or those same court in your system then you'd have to load the cheesy plot to package first Now I want to understand their distribution off this price column So I understand the distribution of this price column I'll just go ahead and build up his 2 g So this is how we can build a history Graham I'll type in Jeezy Blood and I will assign though diamonds Data said onto the detail you So once the Data Lear is done I'll go to the Easter ticks clear and I will map the price column or into the X aesthetic Now I am done with the detail years so have mapped the

diamond service it onto the date all year and I've also map the price Call him onto the axis to take Now it's time to determine the geometry geometries basically the type off Lord which I want to create on dull I would create a history Graham So to create a history Graham we've got the jump hissed a gram function No I'll just hit Enter and we've got this really beautiful plot over here So let me zoom this right So as you see there are a large cell of diamonds so they are around more than 15,000 diamonds whose price would be less than around $1000 Right And there are very very few diamonds so there would be no living around 20 or 30 or diamonds whose price is greater than $15,000 So these were some of those simple inferences which we were able to drop by building this instagram

So now that we're done with the basic DVR manipulation on data visualization will head on to the main part where will be building the linear regression algorithm Now we want to understand How does the price off the diamond very with respect to the carrot off the diamond So let's see if I given a carrot value off around one point three so the carrot values 1.3 Then I'd want to know the exact price off the diamond This is where linear regression comes in Now before we build a linear regression algorithm we actually have to divide our data set into training on the testing said so we'll be building our model on top of the train set and will be evaluating the results on top of the test set So to split the data set into training and testing sets I would need the CIA tools package So those CIA tools packets gives me the sample dot split function So let me just type in sample dot split over here and the stakes in two para meters So the force perimeter

is basically the column with respect to which I want to split my data set on day I want to split this data set with respect to the price Call him So I also like this Price called him over here and I will give in the split issue So I'll said the split re sure to be equal to 0.75 and I will store this in a new object and I will name their object to be split tag Now this retail this commanders executed you guys will be wondering Why do you have to divide a data set into train on and just set So let's take this example to understand it better So let's say you have ah math test tomorrow and you haven't learned anything at all But your friend luckily steals the question People from the principal's room Onda When you see the question people you see that data five questions and you perfectly learn all of those fight grecians Now there are two situations If all of those five questions would appear in the exam then you'd east the example You'll get five or a five

bite water None of the questions appear in the example You'll get zero R A fire right So this is what I'm trying to tell you So we'll have to divide the data set into training Investing set should have to train your model on one particular set and you'd have to test it on another set on If you don't do that and directly go ahead and build your model on just one particular data set then there are very good chances that it might feel on a new data set So this is the reason why we divide into two particular data sets So here we've got this play attack Now let me use the head function and see what is there in the split attack

So split on the score Dag Now as you see you just got a bunch off through values over here So what dysfunction basically does is it assigns 75% off the records with the true values and 25% off the records with the false values Now using this true and false values will divide this entire data set in tow two parts So for this I'd have to use the subsidy function So I'll type in subsidy over here And the first Barham it would be the name of the details it and then I use this plate tag I'll just type and split tag over here And wherever the value of split tag us equal do true I will store this in a new data set and name that data said to be equal to dream Similarly I'll use those subset function again and I'll pass in the first parameter which is the name of the data for him On this time I will said those split back to be equal to falls So wherever the split tag is equal to false I'll take all of those records and I'll store the window That said Now that God or

Green said And the That's it really Now let me have a glance of the number of fruits in the train set and the test it So I'll type in Andrew Off Train and Andrew off best So we see that there are 42,126 entries in the train set and there are 11,814 in prison though that said so now it's time to go ahead and build the morel on top of the train set and a bill the linear regression model We've got this alum function so I'll just type in Elem And the first parameter is the formula where we given the dependent variable and the independent variable So my dependent variable s price After that I'll given though they'll assemble and then I'll given the dependent variable which is carried So I want to understand How does price very with respect to the carrot So whatever value is given on the left side of the tell a symbol that will be taken as a dependent variable and whatever values are given on the right or the tail assemble all of them would be taken as the independent variables This

is my first perimeter which is the formula And then I'd have to give in their data set on which I'd have to build a model So only tell you we are supposed to build this mortal on top of the tree and sit And I will store this in a new object and I'll name it us Let's see Linear mortal one Let me just print it out over here Lean your model one Right So this is what we have over here So call You see that we have the formula price with respect to carrot and it is built on top

of the tree inside and beneath that we've got the Y intercept and the M value for this independent variable so x discarded and the n value or the coefficient off this car It s 7894 and the white Indus it So why intercept for the question A sick will do be X would be the e value we're here So we've got the y intercept and we've also got the M value Or here Now that we've built the modern let's go ahead and predict the values on top of the test said So I'll type in predict Now this takes in two

perimeters so the force perimeter would be the model which you've built and the second perimeter would be the data set on which were supposed to break the values And I want to predict the values on top of the that's it And I will store this in Let's say my results So we've got the actual values and we've also got the director values Now I'll go ahead and combine these two So to combine these two I'll use the sea by and function so the actual values are present in the price column off this test data set So I just named the Scala matters actually and then I will create another column which is predicted on this Richter Values are coming from my result and I will store this and final day Doc

Now I'll have a glance of this So view our final leader So we've got the actual values off the diamond and we've got the predicted values of the diamond Great So let's save This is actual value 3 51 depicted us 54 So there's a huge editor in this prediction over here Now we'll go ahead and find out the residual Audie error in prediction so that would be basically actual minus predicted That's how we find the editor in prediction No uh have to convert this into a data frame first So this is

actually a metrics So I use as dot data for him and I'll pass final data into this and I will store this back to final later on Once we are done with this I will go ahead and subtract the pretty values from the actual values So final data dollars actually minus final data dollar predicted So I'll cut this out I'll be STIs inside these round braces and I'll store this in a new object now name the object to be equal to zero and I'll bind this era back to the same day

Does it So see bind off final data and I am binding it with error and I am storing it back to the seemliness said witches Final data It's a God the actual values They've got the predicted values off the price off the diamond And then we've got the error in production So these are the individual arrested deals with respect toe each point Now we want to find out the residual sum of squares So we have something whereas the root mean square error which basically

gives us the average error for the entire model So as it is stated in the name root mean square error So first we have to find out this crowd off all of these errors so I'll type in final Data Dollar editor Let me got this out and I will go ahead and find out those square off this No once this is done So I have got the square off all of these editors Then I'd have to find out the mean off it great And finally I will go ahead and also calculate the square root off it I'll pieced it

inside this and I use the S Q rt function Right So root mean square off error This is what I'm finding out and I gotta root mean square value off 1002 121 which is actually quite huge So this tells is that the model which we build is not actually accurate for us to give us the right results and I'll store this and let's say R m a C one So this was a simple linear model where prices are dependent variable and carrot was our independent variable Now we'll go ahead and build a multiple linear regression model so this time will use multiple column does our independent variables So let me go to this data set and let me use the Ellen function again

So price again would be my dependent variable And my independent variables would be let's say X y and Zed which are basically the length width and the depth of the diamond So I'll type in X place Why bless said Andi I am building this morning looking on top of the trains it so data would be trained and I will store the Seine linear model toe I have built my model and I go ahead and click the value so I use the credit function on the first barometer would be the model which

I have built which is basically linear too And then I will given though data on which I'd have to break the values which is new data So I want to protect the values on top of the best said and I will store this and my result to I have also predicted the values Now it's time to bind again the actual values and the predicted values So the actual values are present and test dollar price and the predicted values are present and the my result do Right now let me give them their

proper names So I'll given actual over here and I'll also given predicted over here and I will store this final data to So we have our new final date already Serve You are finally got to It's so for the second model which you've built where we had three independent valuables These are the actual values of the diamonds and these other predicted values of the diamonds Now let's go ahead and find out the error in prediction So before that we'd have to again convert this

into a data for him So as dot data stream off final data $2 This is has to be final data to and Duyvil store it back to final data to all right now it's time to find error So final data to dollar actual minus final data to dollar predicted I got this out and I will store the send Eddo Duke Now it's time to bind the era back to the original deal assets So see bind off final data to and I am finding it with two which this store again and final data to So we've got the actual values

though predicted values and the other in prediction Now it's time to find out the root mean square aero for the second model So final data $2 at 02 I got this out We sit inside this let me take the square of the Arab one side B C square off the head I'd have to take the mean off it And once the mean is also done I'd have to take the square root off it so I'll type in sq rt over here Right So this time though fruit means Guerrero comes to be around 1574 Andi I will store this and

let's say R M s E to now let me print out boot our embassy One andare embassy do over here right So for the first model the root mean square terrorists one due to one And for the second model the root mean square Harris 1574 So for the second So for the second model the root mean square error is higher This means that the first model is considerably better than the second model So this is how we can build my tipple models and compared the accuracy with each other So we have

successfully implemented the linear regression algorithm in our language Now it's time to implement the semen bison and Facebook Bush will be working with The ideas do does it So my first us would be to load the bond us luxury so I'll type in import pond us a Speedy Now I'll be using the read underscore CSB function so I'll type in pd dot reid underscore CS Week and inside this I'll give in the name of the file which is basically IRAs dot CS week and I will store this in a new object

Now I landed Object us Iris No I'll have a glance of the head So Iris Dart head And this week amid off first Firoz which are present in the city does it now This day does It is about their different species off the iris floor which are Sentosa Warsi color on Dwyer Janica and these are the different features off these species So I've got the SEPA length CEPAL worth Battleland's and petal word Now for this model I'd want to understand How does CEPAL length off the iris flood Very with respect with Opie talent off the iris floor so separate Lent would be my dependent Variable and petulance would be my independent available so I'll go ahead and divide this entire data set into their dependent variable and independent variable So I will store the separate length into White Do that I haven't just given the name of the data for him which is Iris and I'll give in double braces over here and I'll put in courts and I'll give in the name off the column which is separate

lint So let me just type and CEPAL underscore length over here So I am extracting this separate length column and I am storing it into the variable white Similarly I will extract this Battleland's column from the Irish data set and I'll store it into X given to braces over here And I will give in the name of the column that just battle underscore length and I am storing this into X So I have my dependent variable and independent variable ready Now it's time to

divide thes two into their training set and the testing said so for that purpose I'd have to import the train Test split mattered from the SK loan package So from SK Loan I thought it would be model selection so I'll type in Model underscores election import off train best split so I'll go ahead and import this matter from the SK loan package Now what has done I will use this function so a train tests plate I will pass in the X value and the Y value and then I given the test

size so the test size would be equal to 0.3 So this means that 70% of the record score into the A train set and the 20% of the records going to the that's it And this would basically give us four results So let me just type of those results so the first result would be extreme and then we've got the X test After that they've got white green and then finally they've got white dust So what are these four variables so extreme As basically the training set off the independent feasible than

X test is the best set off the independent variable Then we've got white rain which is the train set off the dependent variable And then we have the whiteness which is the best set of their dependent variable So these are the full results which are given by train test split So now that we have all of these it's time to build early new regression model on top of the train set So I will import the linear regression model from Escalon So I'll type in from SK loan dot lean your model I'd have to import linear regression So now that I import linear regression I have to create an instance off it and I'll name that incense to be our right So I have successfully created an instance off this linear regression model and I'll go ahead than fed this on top of the tree and said So L idot fit And I am fitting this on top off extreme And why train Right So we have for this model Now it's time to break the values on top of the test set so they've caught the credit

function So allow dot predict and will be predicting on top of the tests It and I will store this end Let's say why underscore Fred Now we've got the actual values in the predictive value so the actual values are present in White test I'll type in white us dot head on Then I've got depicted values which are presented wipe red but his own number I worry So I would have a glance of the first fire records that go from 0 to 5 actually Right So these are the actual values off the Zeppelin and these other predictor values off the separate lent to the actual value is 5.7 The value predicted by this model was 5.9

The actual value of 7.4 picked it was 6.1 and they've got 5.1 which was picked last 4.9 Right and free Take this value Seven It was baited US 6.15 so I've got the actual values and afflicted values Now it's time to find out the editor in prediction So I load the mean square error from the metrics office Kaylan So I'll type in from SK loan dot matrix I would basically be importing the mean square So now that I import it I will go ahead and find out the means quite other of

this model And inside this I'll pass in the actual values which are present and white pissed And then the second barometer would be low predicted values which are presented wipe red So that means quite letter comes out to be 0.19 which is actually quite less so It seems that this morning with you build us quite good So in linear regression it's one of the most popular algorithms and production Because it can be used for classification it can be used for regression It also happens

to be one of the core algorithms that is used by many of the algorithms Logistic regression is a linear regression based model right If it takes support Vector machine another very famous algorithm and data science It's a linear model Or if you take uh if you build do linear models using been the data what it called been B I and binned data sets then the modern that you get behaves like a decision tree right So many of the other and Gotham City are very

popular in the industry Internally there linked to linear mode it's you can spend your entire life's time studying linear models It has so much of depth and breadth that it takes a lot of time to actually get used to all the six So today I'm going to start by introducing you to simply need models the core concepts and then subsequently and leave some advanced discussions for the next visit where we'll be covering F empty feature Injuring model tuning there will discuss some further at

once concepts only near Mali's only So I hope these people have loaded by My team has loaded the data set everything I'm going to give you three chords today offiicial covered one in the class The other two is for you to go and explore further Okay Based on what To discuss Nicolas This property is accessible to all of you Can you access this property I think she's going toe You can You can Okay The court is also available The people the The court of the data said you should have received three chords All right let's start as the name suggests this algorithm is called linear regression on the reason why it's called linear regression has names of justice It's based on the concept off a line a line a plane Ah

hyper plane We call it by these names So to begin with I need toe ask you whether you know how a Linus represented line line in mathematics Are you uncomfortable with this All right so let's start Imagine I give you two dimensions This is X excess here One off your independent attributes We call it columns in our day Different right So loaded a data from our table into my data stream on one of the Collins in the data frame I call it X This is my independent variable The other column which I want to predict the target column I call it way It could be anything Why it could be the mpg on it X

could be the weight of the car The more the weight of the car the list of mpg right So why is my dependent variable excess My independent Imagine this X has 456 These are the units 12345 Think these are the measurements off X and let's assume for takeoff discussion Let's assume that whenever excess one why is also one So whenever excess one wise also one That is what you're seeing in the data You take another record there you see X physical to then vice is old Vehicle is also equal to two

eight the third one Excess three Why is this also three So when I tried to draw a line a relationship between them you see it's a straight line The straight line tells you the relationship between X and why How are these two related to each other We in data science call these things as models Models are nothing Berck Sur faces in your feature space What is a feature space feature Space This collection off your independent attributes under different attributes You're trying to explore how this why and this ex interact with each of that interaction is what be represented as models Some mortals are nothing but lines surfaces

Hyper sir Faces in your feature space 70 built k nearest neighbors Okay In Kenya's neighbors you have different classes of data points Suppose these are different classes Okay on Okay let me make it slightly more conflicts What can nearest neighbor does this we call it breaking a mathematical space into regionals It breaks a mathematical space into regions So it says this region belongs to the circular point This region belongs to the strangler point and yes things

on the wrong side Getting nearest neighbors splits your mathematical space into regions Those regions are called Warner regions So this imaginary surface is the modern in Kenya Same linear regression This line which represent the relationship in x and y This line is my morning So I want to predict the value of why given the value of X what the line is saying is why is equal to X So the prediction ISS whenever excess some value Why will also be the same Can I write this expression s Weichel Dwan ICS Does it make any difference One into its this one

In mathematics it has a meaning This one is nothing Bird This angle that line makes with the X axis the time off that angle off that angle into X whenever Why is equal to X This angle will always before the five degrees Okay and in trigonometry ban off 45 years old This one I met him wondering What is this technology Time Petain or literally Jardins actually told comment Since

look at this when we started in school became across trigonometry in trigonometry became ultra signed Teeter costed out And Rita What are the scientist accosted Attended one of these things These are names given to certain ratios So tank Tita is time means the ratio between we sure does d Viber dx How much white changes whenever exchanges by one unit that issues court Hamas Why changes when exchanges But one unit How much white changes in this stuff when exchanges by 100 so one by one

is equal to one de Viber dx How much white changes by small change in x one Entertainment eggs that ratio is called tan Tito sounds very high five but that's what it is Okay So venom er both of them synchronize whenever exchanges by one white in Just buy one It will always happen when this angle is 45 So we say that China fortifies one So when you say 10 afford every developer decks will be one by one Little visit garlic Let me modify this a bit So right now this expression is

represented as am Okay This is a standard practice very represented as m So why equal toe a mix This the expression mathematical expression off this land Suppose I put a line here okay And it's parallel to this line It's battling toe this line Okay which means this line is also making 45 degrees toe the line Parliament X axis I'm not going to show this link It okay just to make it less cumbersome So I have another line here This is L one This is L two No Can I see way critics

then x zero Why is not zero wise to Glenn exist One Why is not one Why is three when access to why is not too wise Four So we add a constant toe This this constant is equal to two right now for this life This constant is nothing But what is the value off wife and x zero What is the value of y given x zero That s Corsi It also goes by the name off Intercept Where India Mathematical space on the white dimension

They're on the by dimension Does the line intercept or cut the Y axis So this is the general equation Off line Weichel toe emits Lissy It tells you how why and excel related If you look at this line L one If you look at l one

then this becomes zero So why equal time makes if you look at l two l toe This becomes not zero but to so this relation continues to remain missing In both the cases the M is seem em is nothing but turn off the 45 degrees we call it slope Right So this is the gender Rick equation one way off representing a line y equals MX plus c So in this expression why is given in your d desert It's a target column X is given in your data set it is the independent columns they live in and attributes from this data that they have given to the algorithm

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent