If you took our client analysis, client and sales analysis, deep dive course, we covered time series
forecasting in that course and much of what we're going to cover here, we covered in that course,
although we're going to go through a little bit different example and we're going to have a practice
exercise that we didn't have in the other course.
But you can you could actually skip this lecture if you want, and really not miss too much.
If you took the if you took our course on customer and sales analysis.
Deep dive.
The Times series forecasting is really an important area of machine learning, and because it gives
you the ability to see ahead of time and make plans in your business based on what that forecast tells
you.
Time series is the collection of data at regular intervals, and it could be in days and hours and months
and years time series forecasting is a technique in machine learning, as we mentioned, which analyzes
data and the sequence of time to predict future events.
This technique provides pretty accurate assumptions about future trends based on historical time series
data.
And that can also that can also include seasonal data.
Time series allows you to analyze patterns or trends in data, seasonality, cyclical periods, irregular
periods, and it's used for various applications.
It's used heavily in the stock market for stock market analysis, pattern recognition.
We showed you how to use it in our in our sales and analysis or customer and sales analysis.
Deepti, of course, for earthquake prediction, weather forecasting, economic forecasting, census
analysis and so on.
So Time series includes trends and cycles and seasonality.
But seasonality and cycles are not the same thing.
So typically you will see a trend, so you might see an increase or decrease in data over a period of
time.
And that's called a trend.
Now, here there's a general on the top.
There's a general trend downward.
And actually this is the same this is the same chart showing a little bit differently.
But basically, this is a general it's it's irregular, but it's a general trend downward.
Then there's seasonal data and seasonal factors would be a specific time of the year, for example,
over the holidays, over the end of the year, holidays, Christmas, holidays and so on.
Amazon, Amazon Prime Day really is more sepulchral.
We'll get to that in a second.
But things that occur, Easter, for example, you have Easter shopping, you have Christmas shopping
and things like that.
So that's seasonal data.
Or you might have drop offs in the wintertime because people can't get out and shop, although that's
less of a factor being able to shop online.
And then you've got cyclical data.
Cyclical data generally occurs, of course, on a cycle, but it's not seasonal and it's not of a fixed
frequency necessarily.
So, for example, you might have something like.
Amazon Prime Day is an example where that happens every year may not be on the exact same dates and
it's not seasonal, but it's a cycle where you can expect Amazon can expect a spike in profits.
Black Friday, the weekend after Thanksgiving, would typically be cyclical.
That although you might consider that to be seasonal, because that does generally occur at the same
time every year.
But in any case, there's seasonal data and there's cyclical data and then there's a general trend in
data.
Now, you might be curious as to what algorithm power by users, four time series forecasting, and
there's two versions that power by users of exponential smoothing, one for seasonal data and one for
non seasonal data.
And probably I will attempt to detect which of the methods it should use based on what it sees in your
data.
So for seasonal data, Halabi uses what's called a seasonal algorithm, it's AAA and it's a model that
uses an equation that accounts for what they call additive error or additive trend or additive seasonality.
And basically, this attempts to predict or look for seasonal patterns in your data.
And it's also known if you're into statistics and I'm not going to get into the statistics of this,
this is not a course on stats and it would bore a lot of you.
But if you're curious, it uses something called a halt Winters' algorithm, and it's used heavily in
business business planning for predicting and planning sales and other business factors.
And then for non seasonal data, it uses a simpler algorithm, a simpler equation which does not factor
in or look for seasonality at all.
And if you're curious about whether the algorithm, if this is the same algorithm that's used in Excel,
it's not quite the same.
OK, it's a little bit different, but it's a similar type process in attempting to do forecasting.
Now, in the next lecture, we're going to get into actually using the TIME series forecasting capabilities
in powered by and we're going to run into something called a confidence interval.
And it's important to have some basic understanding of what that is.
So a confidence interval, a calculation involving a confidence interval takes sample data and produces
a range of values that likely contain the value or the predicted value that we are working with.
OK, so there's going to be some value.
It could be it could be a salesman.
More than likely.
It's a sales amount.
It might be a projected demand in sales.
If you're into sports, it could be the number of runs you expect to score in a game.
If you saw the movie Moneyball, they worked a lot with statistics and trying to forecast or predict
what might happen in the next game and in the next series and so on.
Now, when working with a confidence interval, you'll generally specify some value between maybe 70
percent and ninety nine percent.
Ninety five, for example, is typical.
And if you set a ninety five percent confidence interval, that means that if you were to draw 20 random
samples from some population of data, you'd expect 19 of those to be within the confidence interval
that you specified.
So in other words, and it's easier to show this in the in by, but it predicts a tap value and a bottom
value and.
If you have a 95 percent confidence level, the 19 times out of 20, that value is going to fall within
the lower bound and the upper bound.
And of course, as you increase the confidence level, that range increases.
You could in fact, if you were to move it to 100 percent, you'd have basically an absurdly large upper
bound that an absurdly low, lower bound.
So, again, it's easier to show you this and we're going to get into this in the next lecture.