1. Home
  2. Explore
  3. Computer Science
  4. Linear Regression Overview

Study methods

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

Linear Regression Overview

Transcript

Hey guys this is part of me from Crete learning and I welcome you all to the session on Lee New Regression So Linear regression is one of the simplest and most widely used algorithms and machine learning on Dive created the studio real in such a way that at the end of the session will have complete understanding awfully near aggression Now before we start for the session I'd also like to inform you guys that will be creating the city's off high quality tutorials on dear science artificial intelligence and computer vision So please to subscribe to Greek Learning Syrup Channel and click on the by liking for that you have a notification off our upcoming videos Now let's have a quick glance said the agenda

We'll start The key study will understand the need of regression analysis Then we'll have a brief introduction to simple linear regression and multiple linear regression After will have a demo in both bison and our language is going ahead Will have Professor location was the academic director at Create Learning explaining all the concepts off union aggression comprehensively from some orchestra Has it worked 20 years off industry expedience and market research project management and data science So let's start off with this key city 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 Broden statement is basically this So you were understand of the students who have ah hire CDP all certain to have a higher G i t score And similarly if students have a lower cdp then would they have a lower G I

t score What is the problem Statement Now To find out the solution for any problem you need to gather data So doctors what You go ahead and do it So let's say you go to around 500 odd students on Ask them that Jari 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 visualization So or here You've got this Jari score on you got this CDPF Now what do you do Issue will map the g r E Score onto the Y axis and you'll nab 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 their store for 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 scored Similarly if the student has a low CDP then he'll sort of have a Luigi Ari scored Now this inference was quite easy to draw from this visualization Now what if I actually changed the question So let's say if I asked what would be the geology 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 is 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 are dependent credible and will map the CDP as our independent variable And we will try to understand How would the jihadi score very with Inspector 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 is 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 you're dependent Variable needs to be a continuous numerical value So and this is what we have with respect to what problem Statement So oh here Johnny 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 linear 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

ofa linear 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 students would be around 308 all 309 But the question over here which arises How do you know that this is the best freight line Now let's see if I draw another line like this And 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 jihadi score could be around 312 or three Island 13 So as you see when we changed 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 seem but the value off by will change So this time though Jerry scored would be around our 305 No Similarly we could

have a 1,000,000 Are the lines passing through these set off 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 we'll just take the set off 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 absurd values for the value of X So when the value off excess equal due to

the absurd value off by this five But then again the value which is being predicted by this line would be around 2.0 so their difference between this absurd value off by and their predictive value off why 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 hear the X value is equal due to on the absurd value off Why s four but the predictor value off Why would be around 3.8 Similarly if you take this point x value as four and the absurd value off by a stew 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 that you see these basically indicate the residuals Although editor in prediction 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 we'll go to this first residual and we'll square this up Then we'll go this second residual We'll square this up go to the third residual and then we'll 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 dig the sum this has to be as Louis possible And whichever line would have the bluest value off residuals are more squares That would be the best front line Now let's extend this concept of the previous problems statement So this was our problem statement where the jihadi school was on the Y axis and the CDP of the student was under X axis And we've got these three lines forward here So for the first line the residual sum of squares comes to be around 28 for the second line The residual thermo squares comes to be around 22 And for the third line

though this duel 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 will have an e question associated with it which is basically of I equals MX plus C And that is the question over here So here why is basically the jihadi school of the Student on X is the CDP off the student and these two which you see the OM value and the sea value This we've got from the best freight line So they em 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 G I T School of the student All we have to do with black in the CDP off the students 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 g r e 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 Now will extend this concept and do something known as 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 data set a war here So this is the famous empty cars D does it where we have these columns So this is the MPG column Then we've got the weight of the car

the horse part off the card 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 favorables 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 devoting it with x one horse par with X two number of cylinders with extra and number of girls with export on This is the final equation off this hyper plane over here So it is typing Why equals X one plus bx to play CX three plus DX four plus e And this would be the equation off the hyper plane So implementing linear regression algorithm will be working with this diamond's use it on Let's have a glance of the description of this Does it So the studio said comprise off 10 columns and there are 53,940 does Or in other words there are 53,000 940 diamonds So we've got the price

column which basically notes the prices of diamond and US dollars Then we've got carried which you know it's the weight of the diamond Then we've got God which is for the quality of the cut to have got out 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 dealer manipulation on dinner visualization and let's understand this she does it properly So while started by looking at the structure of the street has it and to look at the structure of the data set I use this str command And inside this ill passengers did acid 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 a new 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 one year subsidy off this entire day does it where the cut off the diamond is equal to premium and the prize is greater than $5000 So for that I'll be using good reply package So let me load of the deep lapac Ege So I'll type in library off the Flyer on but we've got the filter function from the Deploy a package so I'll start by giving the name of the data set which is diamonds on Then I'll 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 diamond's data set

with the fate of 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 to 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 this greater than 5000 and I'll sew this in our new data set on name It does Let's see a premium price Let me have a glance of this So I have a glance of the deal I said I'll be using the view function And inside this I will give in the name of the data set which is premium price Right So are of the 53,000

diamonds we have extracted only 4717 entries where the cart off the diamond as 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 pipe operator and then use the filter function Onda 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 first career than four millimeters So these were some basic data manipulation operations Now we'll go ahead then perform some detail 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 booking 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 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 telegram So this is how we can build a history Grandma 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 Lear and I will map the price column or into the ex aesthetic Now I am done with the detail You're so I've mapped the diamond service it onto the date earlier and I've also mapped the price Call him onto The Exorcist addict Now it's time to determine the geometry Geometry is basically the type off Lord which I want to create on Duh I would create a history Graham So you create a history Graham We've got the jump hissed a gram function Now 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 set of diamonds so they are around more than 15,000

diamonds whose price would be less than a round $1000 Right And there are very very few diamonds so there would be no living around 20 or 30 or diamonds Who's prizes girl in $15,000 So these were some of those simple inferences which we were able to drop by building this test a gram So now that we're done with the basic dealer manipulation on data visualization will head on to the main part where we'll be building a 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 1.3 So the carrot values 1.3 Then I'd want to know the exact price off the diamond This is where Lino Digression 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 Soto split the data set into training and testing sets I would need the CIA to Will's 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 perimeters So the force perimeter is basically the column with respect to which I want to split my data set on Guy want to split this data set with respect to the price column so I'll select this price got him over here and I will give in the split ratio So I'll set 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

bag Now I'll just read the list commanders executed You guys will be wondering Why do you have to divide a data set into train on Dhe Best 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 fight questions and you perfectly learn all of those fight questions Now there are two situations If all of those five questions would appear in the exam than your east the exams you'll get five out of five bite What if none of the questions appeared in the example You'll get zero or 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 said 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 that in the split attack So split underscore attack 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 Do parts So for this I'd have to use the subsidy function so I'll type in substance over here and the first parameter would be the name of the details said 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 set those split back to be equal to falls So wherever the split tag is equal to false I take all of those records and I'll store the window That said Now we've gotta train set and the That's it Really 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 and prison does best said So now it's time to go ahead and build the morel on top of the train set and to build a linear regression model We've got this alum function so I'll just type in Elem on the first barometer is the formula where we given the dependent variable and the independent variable so my dependent variable as 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 tele 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 Who 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 bring the model So I only told you we are supposed

to build this mortal on top of the train set and I will store this in a new object and I'll name it us Let's see Linear model 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 ex discarded and the M value or the coefficient off this car it

has 7894 and the white Indus it So why intercept for the question A sick will do be ex would be the e Val you were here So we've got the white intercept and we've also got the M value or here Now that we've built the model let's go ahead and predict the values on top of the test said So I'll type in predict now the stakes 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 pick the values And I want to predict the values on top of the that's it And I will store this and let's say my result 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 combine these two I'll use the C bi and function so the actual values are present in the price column off this test data set So I'll just name the Scala Mama's 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 data 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 see if this is the actual value 3 51 depicted us 54 So there's a huge error in this prediction over here Now we'll go ahead and find out the residual or the error in prediction so that would be basically actual minus predicted That's how we find the editor

in prediction Noah I'd have to convert this into a data stream first so this is actually a Metrix 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 good values from the actual values So final data dollars actually minus final data Dollar predicted So I got this out I'll be justice inside these round braces and I'll stow this in a new object and I'll name the object to be equal to zero

And I'll bind this era back to the seemed He does it So see bind off final data and I am binding it with error And I am storing it back to the same data set which is final data it So we've got the actual values They've got the projected values off the price off the diamond and then we've got the error in production So these are the individual era Sid deals with respect to each point Now we want to find out the residual some off squares so we have something whereas the

root means square error which basically gives us the average error for the entire model So as it is stated in the name fruit means squared 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 get 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 offered I'll pieced it inside this and I'll use the sq Artie function Right So rude mean square off error This is what I'm finding out And I get a root mean square value off 1002 121 which is actually quite huge So this tells is that the model which we built is not actually accurate for us to give us the right results And I'll store this and let's see 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 e new regression model so this time we'll use multiple columns as our independent variables So let me go to this data set and let me use the LM function again So price again would be my dependent variable And my independent variables would be Let's see 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'm building this morning lugging on top of the train set so data would be trained

and I will store the Seine linear model tow I have built my model and I go ahead and click the value so I'll use the credit function on the first perimeter would be the model which I have built which is basically linear too And then I will give him 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 test said and I will store this and my results too I have also predicted the values Now it's time to bind again the actual values and our

predicted values So the actual values are present and test dollar price and the predicted values are present and the my result too right now let me get them their proper names So I'll give an actual over here and I'll also given predicted over here And I will store this in final data too So we have our new final date already view our final data too 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 to dollar process has to be final data to and I will store it back to final data too 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 store this in Edo Do you Now it's time to bind the era back to

the original data set So see bind off final data to and I am finding it with two which is stored again and final data 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 a row for the second model So final data $2 Addo too I got this out We sit inside this Let me take the square of the rope One side B c squared off the editor 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 r d over here Right So this time though fruit means quero comes to be around 1574 Andi I will store this and let's say R M s E two

now let me print out boot our embassy one andare embassy do over here right So for the first model the root means where terrorists one due to one And for the second model the root means square address 1574 So for the second So for the second mortal the root means square error is higher This means that the first model is considerably better than the second model So this is how we can build multiple models and compare that 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 first full Bush will be walking with No ideas do does it So my first us would be to load the Bond

US Library so I'll type in import Fonda's speedy Now I'll be using the Reed underscore CSB function so I'll type in pt dot read underscore CS Week And inside this I'll give in the name of the file which is basically iris dot CS week and I will store this in a new object now I leaned it Object us Iris Now I'll have a glance of the head So iris dart head and the seleka middle first fire doors which are present in this d does it now This day does it is about

they're different species off the iris floor which are Sentosa wussy color on gua Jessica And these are the different features off these species So I've got the separate length separate battleland and petal word Now for this model I'd want to understand How does CEPAL length off the iris flower Very With respect to the battle island off the iris flowers so separate Lent would be my dependent Variable and petulance would be my independent variable So I'll go ahead and divide this entire data set into their dependent variable and independent valuable So I will store the separate length into white So do that I've just given the name of the data from witches Iris and I'll give in double braces over here and I'll put in courts and I'll give him 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 in

tow The variable white Similarly I will extract this Battleland column from the Irish data set and I'll store it in tow X So I'll give in 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 matter from the s K loan

package So from esque a loan I thought it would be model selection so I'll type in Model underscores election import off train just split so I'll go ahead and import this matter from the S K 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 best size would be equal to 0.3 So this means that 70% of the record score into the train set and the 20% of the record's going to though That's it And this would be slick It was 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 off 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 Dream Best split So now that we have all of these it's time to Billy New Regression Morel on top of the train set So I will import a linear regression model from S Kaylen So I'll type in from esque alone dot lean your model I'd have to import linear regression So now that are important in your aggression I have to create an instance off it And I lean but incense to be our all 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 I don't fit And I am fighting this on top off extreme and white dream Right So we have for this model now it's time to break the values on top of that test said so they've caught the credit function So l a dart predict and we'll 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 predicted value so the actual values are present in white pissed I'll type in whiteness dot head on Then I've got depicted values which are present in white bread but his own Mumbai curry So I would have a glance of the 1st 5 courses to go from zero to five 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 is 5.9 The actual value of 7.4 picked It was 6.1 that we've got 5.1 which was raped last 4.9 right and free Take this value Seven It was breaking us 6.15 So I've got the actual values and afflicted values Now it's time to find out the editor in production So I load the mean square error from the metrics office Kaylen So I'll

type in from escape alone dot matrix I would basically be importing though mean square So now that I import it I will go ahead and find out the means quite editor 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 liberated values which are present in wipe red So that means quite letter comes out to be 0.19 which is actually quite less so It seems that this morning which 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 their algorithms Logistic regression is a linear regression based model

right If it takes support Vector machine another very famous algorithm and data signs It's a linear model Or if you take uh if it build do leaner models using been the data what it called bin B I and been data sets Then the modern that you get behaves like a decision tree right So many of the other algorithms It's very popular in the industry Internally they're linked to linear model ts 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 advance discussions for the next visit where we'll be covering F empty feature Injuring mortal tuning There will discuss some further at once Concepts only near movies 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 is this This necklace This Peabody's 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 need the court of the data state 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 the 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 and presented line line in mathematics are you all comfortable 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 and one of the Collins in the data frame I collect X This is my independent variable The other column which I want to predict the target calling my call it away could be anything Why it could be the mpg on dhe X Could be the weight of the car The more the weight of the car the list of mpg Right So why is my different variables exist My independent video Imagine this X has 456 These are the units 12345 Think these are the measurements off X unless a zoom for sake of discussion let's assume that when our excess one why is also one

So whenever exists one wise also one that is what you're seeing in the data You take another record there you see X is equal to then vice is old Vehicle is also equal to talk Ate the 3rd 1 excess three Why's is also three So when he 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 mortals Mortals are nothing Burke Sad faces in your feature space What is a feature space feature Space This collection off your independent attributes and the defendant attributes you're trying to explore How this why and this ex interact with each other That interaction is what be represented as models The mortals have

nothing but lines Surfaces hyper sir Faces in your future Space seven Evil kay 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 Khan please What gay nearest neighbor does this We call it breaking your mathematical space into regionals It breaks a mathematical space into regions so it says this region belongs toa 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 Regis

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 as y called Juan IX Does it make any difference one into its this one In mathematics it has a meaning This one is nothing

Bert This angle the line makes with the X axis the time off that angle off that angle in tow X whenever why is equal to X This angle will always before different degrees Okay and in trigonometry ban off 45 years old This one I met him wondering What is this technology time beating on literally Jardins actually told comment Since look at this when we started in school became across trigonometry in trigonometry became a CRA signed Teeter costed out and Rita what are the signs

it'll cost You attended one of these things These are names given to certain ratios So Tank Tita is time means the ratio between we show it as de vie over DX How much white changes whenever exchanges by 100 that issue's court homos 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 vibe RDX How much white changes by small change in X one Entertainment eggs That ratio is called tan Tito Sounds very hi fi 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 Ana fortifies one So when you say 10 affordability Viber Dex will be won by one It'll always be one Golic let me modify this a bit So right now this expression is represented as m Okay This is a standard practice Very represented as am So why equal toe a mix iss the expression mathematical expression off this land Suppose I put a line here okay And it's parallel

to this line It's battle in tow This line Okay which means this line is also making 45 degrees toe the line pilot 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 too Now can I see why critics When x zero Why It's not zero wise too correct When excess one Why is not one Why is three when access to why is not too wise for so we add a constant tow 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 why even x zero That s Corsi It also goes by the name off intercept Were Indio mathematical space on the white dimension They're on the my dimension Does the line intercept or cut the Y axis So this is the general equation Off line Waikato emits Lissy It tells you how why and excel related to them If you look at this line L one

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent