Now, let's start with links, simple linear regression model in Python.
For that, first, we have to import Saaz Mother Lode API library.
So we will write.
Stucks mother thought EPA.
s.M.
If you remember what equation from.
Linear regression was bikeways two.
We don't know what must be done X by default, sex moderate do not include this be done time, which
is also known as constant.
Who at this consent to our data and cleared the X or independent variables for our model, will write
X to at some doubt at consent.
And then record will rate.
B.F..
And they squared Rick, right?
There were equitable, which is from them.
Again, we are doing this to create our variable X and also to Erdan constant, which will be what we
done or.
The model will to create a modern object, which is L.M., right?
Asymptote oil, this oil is a sense for ordinary Lisa the squid.
And then record, we'll mention first of why a variable that is dependent variable, which is our price
will, right, B.F. Price.
And our ex, we have already defined politics to separate Elex.
And after that, we will bring the mortals who will not big.
But on this, I would object more to the object visit.
And we have a model.
To get the somebody of this mardon will, right?
The modern name, which is L.M..
Not somebody.
But on this.
We will get somebody, somebody'll photo Martin.
If you remember, our vivos equal to be done or less be done X.
This is a lot to be done.
And this is a little bit be done.
You can also find the standard edit corresponding to each of these be done and be done.
And we also have that P-value for these two barometer's.
We also mentioned in the two Reflektor that be well, you should be less than one percent or five percent
who have a significant relationship between X and Y variable.
So here you can see that our B value is nearly equal to zero.
You can see that that is a significant relationship between rule number and the price variable.
On the top right side, you can also find ballou's of artist squid and just said artist squid.
We mentioned in the two reelected that it should be clear to them point by.
And you can see our artists go to value is near 2.5 and.
This is pretty good, considering that we are only running good simple liquidation more than using one
variable.
Now there is another I hoodoo linear regression in Python.
And this is the most commonly used.
Linear regression matter.
And Biton.
In this matter, we will use a Skillern liberty.
Well, right from a scale on the linear underscore model.
Import linear regression.
One thing you can notice here is that instead of using imported statement, which was import umpires
and B and B or import ban does s speedy, we are using from Skillern Daughton in the unmodern import
linear regression.
The difference between these two is that if we are using imported statement such as for Mambi, you
have to use Alias to use any of its function.
But if you are using this first method, which is from a scale undoubtedly in the unmodern.
You need not need to use Elías, you can medically use their functions.
Just to give you some more information about Escalon.
It's a free machine learning library for the Python programming languages, and it supports various
classification regression and clustering algorithm.
So going forward, what are your other advanced machine learning techniques?
You will be using Escalon only.
For Escalon, we first need to define our X and Y variable, so we will write Y equal to.
Our very dependent variable is the price variable from the diaphragm.
Will right be if it's got a record wheelwright price?
Four x, one thing to note is what X variable will be a two dimensional array?
So why variable was one dimensional umpiring I an exclude evil should be good.
I mean, stun them by arrays will write X.
Well, right.
Well, to be if now to make it two dimensional, Larry, sort of just putting single this good record
I will put.
Whose good record?
And inside it.
I will write room number.
Now, before forfeiting no more than we can first create a word.
Linear regression objects.
Right.
Alem to equate to.
The integration.
We can execute this now.
Allow them to the their regulation object early so we can for total murder, but I think elemental.
But they say this.
We can mention our X and Y.
But.
But on this.
We have out our linear regression, Morten.
Now to see the intercept and coefficient.
Will right rain and record will rate L.M. to.
Intercept int..
And put.
And the school I know this will right them do, but.
You can see we are putting this under school after intercept, and with these two are the attributes
of what linear regression object?
The intercept is minus they put one six five.
This is what we've done.
And I would be Dulan, which is the coefficient of X is nine point zero nine.
Another thing I want to tell you is that if you want to need some more information about any of this
function, you can write tell.
You can get that information using what you can tell and then record, you can mention the object or
the function you want the hell for.
For example, if I want them to.
I can run this.
And I will get this help and documentation of this object.
So here you can see this are the two attributes that we use.
That is quiff and and that's up.
You can read about it in more detail.
See a.
Similarly, if we want to credit the values of why, depending on the linear model we generated, will
write Alem to predict.
And then our equity will.
We can also see this data.
Another variable.
If he does execute the tribunal, we will get this guy discredited values of why.
Not to gloat over a regression line on Abdul.
We'll use Seeman Library.
If you remember, we plotted scatterplot using joint plots of seabourne liberty.
So legs first.
God has rindo.
Of some, this joint block.
Using help, you can get all the information you need to understand each and every function that you
are using.
So, for example, here you can see there are multiple parameters.
We only use X, Y and data.
But there are.
Many more.
But I mean, that's.
Now, the Ford parameter, Urist, is off kind by default.
This kind is set to scatterplot.
To plot regression line, we need to pass this parameter as Greg.
Greg, this central regulation.
You can see there are other parameters as well.
For height ratio or color of the.
We are not discussing it, right?
No, you can ride this on your own.
If we want to plot the regression line, we'll write as soon as it's on.
Go join Block.
Then I would x variable X equal to.
Be it.
And then the squared record with will mention of a excludable, which is the.
I will mention our way of variable, which is or more for the WNBA.
Then kind equate to that, that.
So if we run this.
You can see we have the Lord be able to get a lot of praise and a number.
And we can also see a line passing through this.
This is a regression line that we generated.
We have already discussed the slope and intercept of this line.
But just to use your lies.
This we can afford to be using seabourne liquidity.
Another thing you can more this is that what we done was around nine and the meaning of 11 was by increasing
the value of X.
Much by will increase.
So you can see by increasing one value of X.
So suppose from four to five hour X.
What vibe will increase from zero to 10?
You can say that roughly it will increasing.
It will increase by nine units.
That's all you interpret the growth focus on this.