Better Forecasting with AI Powered Time Series Modeling BKG

Better Forecasting with AI-Powered Time Series Modeling

December 15, 2022
by
· 7 min read

AI-powered Time Series Forecasting may be the most powerful aspect of machine learning available today. Working from datasets you already have, a Time Series Forecasting model can help you better understand seasonality and cyclical behavior and make future-facing decisions, such as reducing inventory or staff planning. By simplifying Time Series Forecasting models and accelerating the AI lifecycle, DataRobot can centralize collaboration across the business—especially data science and IT teams—and maximize ROI.

AI Forecasting Can Overcome Real-World Complexity and Integrate Existing Processes  

While AI-powered forecasting can help retailers implement sales and demand forecasting—this process is very complex, and even highly data-driven companies face key challenges:

  • Scale: Thousands of item combinations make it difficult to manually build predictive models 
  • Real-World Complexity: The constant changing conditions of demand swings, uncontrolled factors, such as the COVID pandemic, and internal activities are hard to forecast against and can render models useless overnight
  • Integration and Disparate Tools: Within the same organization you might have different teams working with different technologies, tools, and frameworks, so there is a challenge in consistently of forecasting answers, making alignment more difficult and slowing down time to value 

Why is it so difficult to do it manually? For example, just to forecast sales on a shirt with five different sizes in five different colors gives you 25 combinations. Now, add over 5,500 store locations with a 7-day rolling forecast—which actually takes 42 days to forecast—and you’ll get more than 5 million predictions. 

Forecasting for one single item leads to more than five million predictions
Forecasting for one single item leads to more than five million predictions

This is where the DataRobot AI platform can help automate and accelerate your process from data to value, even in a scalable environment. Let’s run through the process and see exactly how you can go from data to predictions. 

The use case will be forecasting sales for stores, which is a multi-time series problem—both supervised learning and time series regression. In this use case, the forecasting will be on a day resolution, but for other Time Series Forecasting, the resolution can be different, such as a month, a year, etc.

The process I will present will be using the DataRobot GUI. For code-first users, we offer a code experience too, using the AP—both in Python and R—for your convenience.

Setting up a Time Series Project

The machine learning life cycle always starts with the dataset. Import the data from various options: from a local file or URL or create a data connection with diverse data sources, such as Snowflake or Amazon Redshift, and upload it to the AI Catalog, which helps manage datasets, versioning, and shared capabilities with other users. 

If your dataset is not in time order (time consistency is required for accurate Time Series projects), DataRobot can fix those gaps using the DataRobot Data Prep tool, a no-code tool that will get your data ready for Time Series forecasting. 

Prepare your data for Time Series Forecasting - DataRobot AI Platform
Prepare your data for Time Series Forecasting

Once the data is ready, DataRobot will do some initial exploratory data analysis –  in addition to a data quality assessment of the data – to get a deeper understanding of the dataset prior to model training. As you dive in, you can look at the distribution of each feature, identify outliers, target leakage, or missing data, create a var transformation, better understand what those features may be, and more.

Perform exploratory data analysis - DataRobot
Perform exploratory data analysis

Once the data is ready to start the training process, you need to choose your target variable. When we choose ‘sales’ it’s immediately recognized as a regression problem. Note: the DataRobot platform supports both supervised and unsupervised learning

Configuring an ML project - DataRobot
Configuring an ML project

Next, you need to set up the time-aware modeling settings, including the Feature Derivation Window (FDW), or how long of a period you may need to generate features that would be relevant for your problem. Then generate a Forecast Window—which shows the futures period you want to forecast—and the operationalize gap (the period of time for which forecasted predictions can’t be made actionable).

Settings for Time Series projects - DataRobot AI Platform
Settings for Time Series projects

Calendars can also help you understand seasonality and incorporate it into the forecast model. For example, how holidays and events affect forecasting. If you don’t have your own calendar, DataRobot will generate one based on your location. 

Attach calendar for TS projects - DataRobot
Attach calendar for TS projects

Advanced settings allow you to configure additional parameters to the forecasting project, like “known in advance” (KA) features—that don’t change after the forecast point—such as marketing promotions, tourist events, and more.

I could also configure the project based on segment, which will result in multiple projects “under the hood.” Once the segments are identified and built, they are merged to make a single-object—the Combined Model. This leads to improved model performance and decreased time to deployment.

Select KA Features that will not change after the forecast point - DataRobot
Select KA Features that will not change after the forecast point

The DataRobot Training Process

Now that all our settings are in place, we are ready to go. To begin training your model, just hit the Start button and let the DataRobot platform train ML models for you. Based on the FDW, new features will be generated. You can dive into each one of them and explore the feature lineage, allowing you to see the transformation from the original feature to the one that was created.

Explore Feature Lineage to see the transformation from the original feature to the one that was created - DataRobot
 Explore Feature Lineage to see the transformation from the original feature to the one that was created

You can also see the correlation between each feature and the target variable. In the background, models are being trained in parallel for efficiency and speed—from Tree-based models to Deep Learning models (which will be chosen based on your historical data and target variable) and more.

To accelerate the process, you can also increase the number of modeling workers (number of jobs running at the same time).

A variety of models are been trained in parallel - DataRobot
A variety of models are been trained in parallel

After your project has been finalized, you can review all the models that were trained. The order of the models will be based on the project’s metric—and can be changed based on your configuration. In the training process, different models with different feature lists and training periods were tested, and only the best performing models continued to the next round, resulting in the first model listed in the leaderboard, which is the recommended model by DataRobot for deployment. 

The Leaderboard of trained models—ordered based on your metric - DataRobot
The Leaderboard of trained models—ordered based on your metric

Changing the order of the Leaderboard based on a different metric - DataRobot
Changing the order of the Leaderboard based on a different metric

The model training process is not a black box—it includes trust and explainability. You can see the entire process from data to predictions with all of the different steps—as well as the supportive documentation on every stage and an automated compliance report, which is very important for highly regulated industries. 

DataRobot Blueprint—from data to predictions. ML pipelines containing preprocessing steps, modeling algorithms, and post-processing steps.
DataRobot Blueprint—from data to predictions. ML pipelines containing preprocessing steps, modeling algorithms, and post-processing steps.

Generate Model Compliance Documentation - DataRobot
Generate Model Compliance Documentation

Model Performance, Insights, and Explainability

Do you want to see how your model is performing? Looking at Accuracy Over Time allows you to see the actuals versus the predictions of the model—and shows how seasonality and calendar events are incorporated. Advanced Tuning, meanwhile, will enable you to further tweak the model. 

Track Accuracy Over Time to see the actuals versus the predictions of the model - DataRobot
Track Accuracy Over Time to see the actuals versus the predictions of the model

Are your business decisions aligned with the model results? On a macro level, see which features drive the model’s outcome. On a micro level, discover how a change in a specific feature affects the target variable. For example, choosing the ‘tourist event’ feature shows us that holding such events results in higher sales.

All of the from the platform can also be exported outside of DataRobot. 

See which features contribute most to the model - DataRobot
See which features contribute most to the model 

How each feature contributes and affects the target variable - DataRobot
How each feature contributes and affects the target variable

The Deployment Process

Now it’s time to put our model into production and get some predictions—and unlock real value and ROI. There are multiple ways to do so. Perform ad hoc analysis on your dataset and preview the predictions for the upcoming seven days for a specific series. You can also deploy the model using the DataRobot API—ensuring a smooth and fast connection between data scientists and the IT team.

Make predictions, deliver value, and unlock ROI - DataRobot
Make predictions, deliver value, and unlock ROI

Perform ad hoc analysis and preview upcoming predictions - DataRobot
Perform ad hoc analysis and preview upcoming predictions

In general, using DataRobot MLOps, you can also see models that you currently have in production—from different training and deployment environments. Check for model accuracy and data drift and inspect each model from governance and service health perspectives, respectively. If your model is decaying, you can replace it with a more accurate challenger model—which can be monitored with automatic rules and notifications. 

Deploy your model using the DataRobot API
Deploy your model using the DataRobot API

Check all your models at a glance - DataRobot
Check all your models at a glance

Monitor model accuracy over time in production - DataRobot
Monitor model accuracy over time in production 

Challenger models compete against the champion model - DataRobot
Challenger models compete against the champion model

Close the loop by connecting your predictions into any database—including batch or real-time predictions using the DataRobot API. And to connect to the business, you can connect predictions to your business application. For example, I used Tableau in this use case. On the top, you can see the overall forecasted sales for the next seven days in all the stores combined, and on the bottom, you have each series (each store) displayed individually. 

Connect predictions to your business application - DataRobot
Connect predictions to your business application

Accelerate the Machine Learning Life Cycle with AI-Powered Forecasting

Time Series Forecasting might be the most powerful aspect of machine learning available to organizations today. The ability to strategically plan for what’s to come can set you apart from your competition. 

With accessibility from the UI, but also from code—and with Trusted AI and explainability to help increase the value and unlock ROI—the DataRobot platform can help your organization quickly make accurate predictions and get actionable insights.

To see a demo on how you can leverage AI to make forecasting better, and accelerate the machine learning life cycle, please watch the full video, AI-Powered Forecasting: From Data to Consumption.

AI Experience 2022 Recordings
AI-Powered Forecasting: From Data to Consumption
Watch On-Demand
About the author
Atalia Horenshtien
Atalia Horenshtien

AI/ML Lead - Americas Channels, DataRobot

Atalia Horenshtien is a Global Technical Product Advocacy Lead at DataRobot. She plays a vital role as the lead developer of the DataRobot technical market story and works closely with product, marketing, and sales. As a former Customer Facing Data Scientist at DataRobot, Atalia worked with customers in different industries as a trusted advisor on AI, solved complex data science problems, and helped them unlock business value across the organization.

Whether speaking to customers and partners or presenting at industry events, she helps with advocating the DataRobot story and how to adopt AI/ML across the organization using the DataRobot platform. Some of her speaking sessions on different topics like MLOps, Time Series Forecasting, Sports projects, and use cases from various verticals in industry events like AI Summit NY, AI Summit Silicon Valley, Marketing AI Conference (MAICON), and partners events such as Snowflake Summit, Google Next, masterclasses, joint webinars and more.

Atalia holds a Bachelor of Science in industrial engineering and management and two Masters—MBA and Business Analytics.

Meet Atalia Horenshtien
  • Listen to the blog
     
  • Share this post
    Subscribe to DataRobot Blog
    Newsletter Subscription
    Subscribe to our Blog