>> You're not going to want to miss this episode
of the AI Show where we learn all about
time series forecasting with automated machine learning,
a new capability that you can use
today, make sure you check it out.
[MUSIC]
>> Hello and welcome to this episode of the AI Show,
a special build addition,
where we're talking about time series forecasting
with automated machine learning.
I've got a special guest with me.
Hello my friend, tell us who you are and what you do?
>> Hi everyone. My name is
Sabina Cartacio and I'm a Program Manager for
Azure Machine Learning and I
focus on forecasting with automated ML.
>> Thanks Cartacio.
Let's start with the first and obvious question,
what is time series forecasting?
>> So time series forecasting is the process of
using historical data to predict future observations.
This is commonly used in industry for tasks such as financial,
resource, inventory and capacity planning.
>> That's amazing. So what kinds of things
do we have to consider when we're doing forecasting.
I understand the historical data nature of this,
but is there anything else we need to think about?
>> Yeah, well when creating a machine learning model in general,
we have to consider many different
algorithms and hyperparameter values.
When we focus specifically on forecasting,
we need to consider seasonality,
trends and even the effects of holidays.
>> So you're saying that my data that has
time series is just different inherently.
It sounds like it makes things a little bit more complex though.
How do we train models with these additional considerations?
>> Definitely. So it is very tricky to consider all of these,
but what if instead of manually considering all of these factors,
we could actually automate them.
So with automated machine learning,
we can automate the algorithm selection,
the hyperparameter value surge,
as well as even data featurization, including holidays.
This all comes together to basically help you
find the best machine learning model for your data.
>> So we already had automated machine learning before,
now what we're doing is we're basically making it work
with new time series forecasting data, is that all right?
>> That is correct, yes.
>> All right, who is using this?
>> So we have a few deeply engaged customers.
As you can see, some of these include Wood Group,
Schneider Electric, Walmart, JNJ,
Pepsi, and most recently DriveTime.
>> All right, so let's see. I'd love
to see one of these use cases.
Is there a particular customer you'd like to focus on?
>> Yeah. Let's focus on DriveTime.
So a little bit of background on DriveTime before we jump in.
DriveTime is actually one of
the largest used car retailers in the United States.
They focus on helping customers find
the best vehicle and financing for their needs.
>> All right, so what are they doing?
>> Yeah, so they're actually are
building using Azure Machine Learning.
They're building ML pipelines and leveraging AutoML to basically
fuse automated modeling into
their proprietary scoring and finance models.
>> So I'm trying to understand,
so what about their data makes it time series based data?
>> Yeah. A lot of times especially in finance,
what we're looking at is trends.
So we want to know for a financial cycle how maybe
things are selling or whether or not customers are returning,
and a lot of this is based under a seasonality.
How do things act over time,
and they tend to repeat.
That's where we get trends.
Around Christmas, toys sell more.
It's that pattern that you're looking for with time series.
>> So basically what they did is they fed their data
to automated machine learning and it just generated models.
How many models did they generate?
>> Yeah. So they actually built
a multi-step pipeline using ML pipelines to
process their different data and they ended up
building over 20,000 different models.
This was not just models,
but also featurization techniques and hyperparameter values,
and they were able to cherry pick
the best model for their use case.
Going forward, they are even looking to optimize this whole setup
and make it usable for their other high-volume data scenarios.
>> That's really cool. So tell us a little bit more about
automated machine learning's forecasting capabilities,
because I think this is a new thing.
>> So the first thing that you can see here is deep learning.
We actually had a DNN web
forecasting specifically that was brought in Microsoft research.
Along the same lines,
we also have forecasting specific backtrack.
We also have models that are popular
within the forecasting realms such as a Riemann profit.
These models are wildly popular and
they're available within automated machine learning.
Alongside this, we also have auto settings and holiday detection.
>> What do you mean by holiday detection?
That's interesting to me.
>> Yeah, this is definitely a very popular feature.
Essentially you just specify your country or region and
AutoML will go ahead and enrich
your data with holiday information.
>> That's interesting to me because
usually when it comes to seasonality,
like holidays are usually when things are just weird,
and we have to make sure that we account for that weirdness.
>> Exactly.
>> So we've talked a lot about this.
I'd love to see some demo,
do you have something you show us?
>> Yeah definitely.
So we're actually going to go through
an example of orange juice forecasting.
So we have a couple of stores across
the United States that are selling
different brands of orange juice,
and we want to know how they're selling, so the quantity,
and we're going to walk through this notebook,
it is a basic automated ML notebook at the skeleton
with some forecasting
specific variables that we're going to talk about.
So the first thing we're going to do is like with
any automated ML experiment just go ahead and setup.
So we're importing the red libraries
making sure that our subscription is setup correctly,
and the next important thing is the compute.
You're able to use either local or remote compute.
Moving forward, we start with
arguably the most important part, the data.
So here we can see that we're passing in the time, column, name.
The time, column, name is WeekStarting.
We always have to specify what
the time is for time series forecasting.
We actually have weekly data.
Although if you notice here, we have
the same timestamp repeated many times.
This is because we have a unique combination of store and brand.
So here we can see we have Store 2 for Dominicks, Minute Maid,
Tropicana, and then you see the same date before a new store.
So that's the trend of our data.
>> Before we go on and this is what makes it intrinsically
time series based is that we have a timestamp of store,
but the timestamp is coupled with in this case a difference store.
So that way you have two things going on at the same time.
>> So this is actually a multi-time series problem.
So we are dealing with multiple time series
and AutoML can handle this,
and I'm going to show you how we do that.
>> Awesome.
>> So right here to your question,
we have a variable called time_column_names,
and this is what we referred to internally as a time series ID.
How do you uniquely identify these duplicate timestamps,
and we said that this was the combination of store and brand.
We're going to actually go ahead and cut down this problem a
little bit and we're just going to focus on three stores;
stores 2, 5 and 8.
We saw from above that there are
three brands of orange juice for every store.
So it's actually telling us that when we
cut down to only three stores,
there are nine individual time series.
>> I see, cool.
So basically it's going to do
the combination for all of those stores,
all of those times.
>> Exactly.
>> I love it.
>> The next part is the data splitting.
This is pretty standard for most machine learning,
but one thing I want to take note here is these end test periods.
What this is referring to is your forecast horizon.
So this is how far out into the future you may want to predict.
If you notice we're not passing in a unit,
that's because we infer the unit from the data that's passed in.
So in our example we know that we have
weekly data so this 20 [inaudible].
>> I see.
>> Then we're just going to go ahead and upload
the data to the data store,
and as you can see there, and then create a dataset for training.
Now I do want to point out here that we're printing out the tail.
So the end of the data,
this is extremely important because when you go to
predict out or forecast out those 20 units,
you know that you have to start from this date point,
from the last date in the training data.
>> Got it.
>> Now we go into modeling.
Again this is a pretty standard process for all machine learning.
You're just passing in the target column,
what you want to predict.
In our case it's quantity;
how much orange juice was sold.
We also have a small step and customization.
This essentially allows you to decide if you want to
drop certain columns or change how they're imputed.
So if you have a missing value, should we use mean,
should we use pass contexts to fill
future contexts. You can decide all that.
>> Got it. So standard machine learning featurization stuff.
>> Exactly.
>> Got it.
>> Below training; the training
is exactly the same as other AutoML.
If you noticed the only difference here
is we have specific time series settings.
So we're setting that time column, that grain,
and that horizon that we talked about,
and then we're passing it in at the bottom here to AutoML.
Once that's done, we go ahead and submit that run.
You can go ahead and track this run in
the studio and I'll show you
quickly what that looks like once it's done.
So here I can see many different models that were attempted,
and I can go ahead and dig into them,
I can see graphs and more metrics for each of them.
Here we're going to focus on the best model.
So we retrieve the best model which
happens to be the standard scalar rapper,
and we can even get transformation and
transparency for this model.
So we can see all the different transformers,
we can see the detected type,
whether they were dropped in
the preprocessing state or not and more.
>> This is cool. So basically it's just standard,
because the data is only thing is different,
after that it's just standard automated machine
learning with just an additional three settings?
>> Yes.
>> That's cool.
>> Then it becomes a little different when
we come at the evaluation portion.
So when we come to actually gather forecasts,
because we're actually time aware.
So that's the next different step.
So here we're going to quickly view
the test data that we're going to pass in.
So if we were to look at the tail
from above and this would be able to see that
these dates fall within a range of
the last date and 20 units forward,
and we're not passing in quantity,
so we're not passing in that target.
So if we go down here,
what we're going to do is evaluate.
Before we actually ask for predictions,
what we want to know how did this model perform,
let me see some metrics,
some of the validation that was done for the model,
and you can see how the model performed.
So I ran this one for a very short amount of time but it's
still pretty impressive to see such good results,
but now I'm more interested in how do I get my forecast.
So we're going to operationalize this.
When we see operationalize,
we mean that we're going to develop
a scoring script and we're going to deploy the model.
This is going to generate a REST API and
we can hit that endpoint to get our forecast.
So here we're deploying as an Azure Container instance,
and then we're going to call the service.
So what we see here when we call the service is
that we have a new column of data,
forecasts, and these are actually
the predictions returned from the model.
>> I see. Can we scroll up because I have
a couple of questions here?
>> Yeah.
>> So as we scroll up,
the one question I had was about that one right there.
So if we scroll down,
so developing the scoring script,
is the scoring script something that developer would
have to write line in 27 I think?
>> Yeah, so we can actually develop the scoring script for you,
but a lot of times when we think
about the data scientists persona.
This persona might want to go in and actually further develop
the scoring script to meet their needs and
actually analyze the model compared to other models.
However, if you are more than
that developer [inaudible] data scientists role,
you don't have to worry about it.
This is giving you access to it,
should you want to do more, but it's all automated.
>> So it's the best of both worlds because basically if you
just want to use the best model
of all the millions of them that you ran,
then it just has this scoring script
for you that you can just use,
but if you're a data scientist and you want to evaluate, "Okay,
I'm going to use this as the starting point for
a starter model and then do
more research from there," you totally have that option as well.
>> Exactly.
>> This is pretty cool.
Where can people go to find out more?
>> Definitely. So I've actually
gone ahead and included two links here.
The first one is actually a tutorial for
our UI offering which we saw very quickly on the studio,
and running you through our forecasting example.
Now if you want to get more in depth,
I have a second URL,
www.aka.ms/AutoMLForecast and this is a very in depth on how to,
showing you everything that AutoML does
behind the scenes with time series ML.
>> Well this has been really amazing.
Thank you so much for spending some time with us.
Thank you so much for watching,
we're learning all about time series
forecasting with automated machine learning,
make sure you check it out. See you next time.
[MUSIC]