Time series analysis on AWS — Part 1 presentation — Forecasting

Michaël HOARAU
6 min readMar 9, 2022

In my previous post I gave you an overview of what you can expect to learn in the first chapter of the book “Time series analysis on AWS”:

Equipped with the knowledge of this introduction, you will dive into time series forecasting with Amazon Forecast. This service is the first AI/ML managed service you will go over in this book and is dedicated to time series forecasting. As with the other services described in this book, you will learn how to train your own forecasting model and predict future values for your time series, without writing a single line of code and only using the AWS console.

Amazon Forecast overview (image by author)

Note for developers and ML experts

As a developer and/or machine learning practitioner, anything you will do in the console while following along these chapters will help you understand the philosophy of the service and its limitation with regards to your datasets and use cases. Although you will likely move quickly to using the dedicated API of Amazon Forecast (the API documentation will come in very handy then!), reading through these chapters will then help you build sound forecasting features you would like to integrate into your own applications.

Important note, service updates

Amazon Forecast is a cloud service: as such, it can be updated at any time by the service team to let customers benefit from the latest and greatest features. On the other hand, this book was written at a certain point it time and since then, new features may have been announced.

To let you get the most from the book, I will keep updating this blog post to tell you about the new features that were not available at the publication date.

High level overview of part 1

In the first part of this book, you will learn about Amazon Forecast and how this AI/ML service can help you deal with forecasting challenges. This section is structured around the following six chapters:

Chapter 2, An Overview of Amazon Forecast

In this chapter you will learn about the type of business problems you can solve with time series forecasting, get a thorough overview of Amazon Forecast and understand when it’s likely to work well or not for your applications.

Chapter 3, Creating a Project and Ingesting Your Data

This chapter exposes how the service structures the dataset to help you frame your forecasting problem. You will learn how to create a new project, ingest your files and use related AWS services in the process (namely Amazon S3 to store your datasets and AWS IAM to securely give access to your data).

If you want more details about how you can prepare your data to feed Amazon Forecast, check out this in-depth article on the AWS Machine Learning blog. You may have to partner with a fellow developers to better leverage this piece of content though.

Chapter 4, Training a Predictor Automatically

This chapter will see you training your first predictor, using the default parameters. The key highlight of the chapter is the section dedicated at interpreting the model evaluation dashboards and learning about the most relevant metrics for forecasting problems.

The Amazon Forecast service team recently introduced a new API that uses ensembling to improve the models accuracy. The previous approaches are now considered legacy and will only be available in the console to users who created their AWS accounts before February 25, 2022. Both the new and legacy approaches will of course stay accessible through the API calls should you be an old or new customers. Only the console user interface will change depending on when you created your AWS account. This may impact some of the screenshots for both chapters 4 and 5, although everything else should be consistent. To learn more about this feature, check out this blog article on the AWS Machine Learning blog.

Chapter 5, Customizing Your Predictor Training

In this chapter you learn how you can customer legacy predictors by selecting an algorithm and customizing the training parameters. You also learn how you can reinforce your backtesting strategy or use additional datasets already prepared for you (namely, holidays and weather data). One of the most important feature you will learn about is how to select the best quantiles to match your business needs.

When training a new predictor, Amazon Forecast now allows you to select a custom horizon starting points. Many users expects their forecast horizons to start on a given day and time that closely aligns with their business needs. For more details on how to take advantage of this features, you can read through this blog post on the AWS Machine Learning blog.

Chapter 6, Generating New Forecasts

Equipped with a trained model, you will learn how you can request new predictions by generating a new forecast. You will also get a hint at how you can generate explainability for your forecasts to help you substantiate your model’s predictions.

Since the time of writing, Amazon Forecast now allows you to generate forecasts on a subset of items (instead of generating them for every item in your dataset). This gives you a fine-grained access to which item you want to focus on. For more details about this new feature, you can read through this blog post on the AWS Machine Learning blog.

Chapter 7, Improving and Scaling Your Forecast Strategy

The key highlight of this chapter is the usage of a serverless architecture you will leverage by orchestrating different AWS services… And again, without writing a single line of code! The skills you will acquire in this chapter will be valuable for many orchestration tasks you might have when automating your AI/ML projects on the AWS cloud:

Serverless architecture around Amazon Forecast (source: AWS Solutions Center)

The Amazon Forecast team added a new critical feature to monitor your deployed models in production. Amazon Forecast can now automatically monitor your deployed predictors and detect bias and drifts over time. To achieve this, the service automatically computes accuracy metrics on the new data provided for inference purpose. Depending on how these metrics evolve over time, you will be better informed about the decision you need to make: keep using your predictor, retrain the existing model with an updated dataset or create a new predictor altogether. For more details about this cool new feature, feel free to read through this article on the AWS Machine Learning blog.

New features summary

Here is a summary of all the blogs pertaining to new Amazon Forecast features that were announced after the book was published:

Conclusion

Upon completion of this part, you will have trained a forecasting model and you will know how to generate new forecasts based on newly available data. You will also have learned how to get deep insights from your model results which will help you either improve your forecasting strategy, or gain a better understanding of the root causes for a prediction made by your model.

In the next post, I will present the content of the second part of the book, chapters 8 to 12, dedicated to anomaly detection with Amazon Lookout for Equipment.

The book is now available worldwide on Amazon. Here are a few links:

I hope you’ll find it interesting, feel free to leave me a comment here and don’t hesitate to subscribe to my Medium email feed if you don’t want to miss my upcoming posts! Subscription link is here:

Want to support me and future work? Join Medium with my referral link!

Let me know your thoughts!

--

--

Michaël HOARAU

Industrial AI solution architect at AWS. Time series lover. Willing to support more stories? https://michoara.medium.com/membership