Hey, guys, now let's see how to do the forecasting, the altitude model in Python.
All right.
In the previous lecture, we talk about the simple linear regression and this is what the output which
we got.
And if at all, you can see this is what the output and Peter want is simple, linear.
And also the forecast is also just extension of this line.
And whatever the feeling part, you can see, this part is basically the confidence interval or margin
of error.
Now, let's go back like let's see how to build a.
So this is what the data we're interested in.
So what we will do will take the strain data on that as data.
We already use this with that.
And we will take this train data and the data and for this train data and put the stats data, we will
take the regression or attitude modeling for this.
All right.
So let's get ready.
So click on this text and type the attitude model.
How did you model is basically adding up the seasonalities.
You're just adding up the seasonality.
So let's take this leg up on the train data.
So this is the train.
So we have the train data and we have already the data as we preprocessed.
We've already taken up the time.
We already taken up the month.
We already got the time as well as the month.
So what we need to do here is that we need to create the dummy for this and they've done this.
We need to extract it.
So before that, let's start with the basic visualization so that you can understand much better how
exactly that can all be able to calculate the seasonality here.
All right.
So first step, what we do is that we will draw the scatterplot.
We will draw the scatter drawn between the idea of the school train.
This is my training data.
And I would take the time component is what makes access or so.
And we can take one more thing for both of sales.
So this is basically the scatterplot, which looks like, all right, we got some error.
Yeah, so property.
X and Y, this is the first code train.
All right, so it's a slow train and this is how it looks like, OK, basically like, you know, and
you can take the block.
And if you take the same values on the X axis, these the school year and years on this.
And if you want the blue lines and this is how you get in, so I'll go with the dotted lines.
That will be nice for me.
So this is a just joining of each and every point.
This is how it looks for me.
All right.
Let me increase up the size of being able to go and pick size.
And I take this to the standard 15 to eight.
So this is the way to look at the big block now.
So this is quite true.
All right.
So what I will do now is that let me color it.
So what I'll do instead of being the only the scatterplot, the plane.
So what I'll do.
Let me color according to the month.
Let me color according to the Moniz's, according to the MONDLI.
So to do that I can use the seabourne dot scatterplot.
So we have the bond brought there.
So you have access on the train of EOS or.
All right.
I can take it like it is.
X axis and y axis is sales and the data is equal to the from the school train.
So if I see that the scatterplot and this is how this guy got all right.
So and I can still increase the size X is equal to something like three hundred, I can increase the
size of my silicones like Bego Cycos.
I can get with this and medium level up so I can get to Endre.
And so this is, this is, this is what I can get is what I can really get from this.
So what I can do, I will, I will basically color with you is basically the coloring font and you can
color this using the.
Month them.
So this is the month name I can use this month, name and color recording.
Yes.
Now you can see we have the coloring.
This is the January, February, March, April, May, June, July, August.
And you can see the plot is being repeated.
The plot has been repeated and it's clearly visible, like how exactly the data has been changing.
So according to the colors, we have it later.
And if at all you want this month name you could all on this month name to be displayed.
And we can also do that using the power to text be able to detect is an excellent way of doing that.
What you do what we need to do here is that we need to give the exposition and we need to give the Y
position and the text and we need to do the Y position.
And finally, we need to do the text here.
So this is the text.
So the deal follows train and it's a month we can get it, but we have to do the step by step if we're
not put on the spot.
So what I'll do for I in range or for I in range of.
You can take it from Lentol Daftness Catrine.
So this is where to put all these values, I can iterate this and for each and every part I'll take
it to I.
And this is also I.
This is also I and this is also my eye.
So you can get all the violencia.
So what I mean to underscore, for example, predict like zero you'll get the zero to value.
So this is the zero is nothing like a two thousand.
And so those information you can get if at all, you want the month of detail, you will get the January
and February one and so on.
So they can do like an excellent way to execute that.
And you can see that, you know, this is a January, February, March and May, June, July.
And you can easily plant it and you can see the behavior, how exactly the data has been there.
And you can see that.
All right.
So we can also do one more thing.
That is a one special.
May I use it for, like, you know, setting up these options?
It is like coloring.
I use this this time on the set.
And one is also the color map.
This is nice color map where we can segregated, sort of like the rainbow colors.
It's a solid line, solid color to each and every month.
It's really the coolest part.
But the problem is that you like.
But it's OK then it is.
The color is being repeated but still we can understand much better visualization than the previous
one.
But anyway, but one thing we can see is that we can see the seasonality part here is 12.
So roughly, roughly every year that's the cycle has been repeated and roughly making up like every
year the cycle has been repeated.
So in this case, my seasonality is to OK, so now the season from this observations are right on seasonalities
to all.
Seasonalities, Twala.
And we need to create, create and minus one dumbness, so which is basically 11 double's 11 columns.
OK, so I need to create 11 columns here.