Skip to Content
Scaled Forecasting with Python and R: With Forecasting for Several Different Types of Models and Time Series
on-demand course

Scaled Forecasting with Python and R: With Forecasting for Several Different Types of Models and Time Series

with Michael Keith
January 2021
Beginner to intermediate
1h 20m
English
Apress
Closed Captioning available in English

Overview

In this video, you will explore forecasting techniques in Python, including how to use machine learning models from Scikit Learn, as well as integrating R as a sub process to gain access to the robust forecast library, incorporating the auto.arima and tbats models. We create our own Python class called Forecaster that stores all of the relevant information about the predictions, including error metrics, model forms, hyperparameter selections, and the forecasts themselves. The module is written in such a way that models can easily be added to the framework for increasing accuracy.

In the specific scenario, we are forecasting on 150 separate time series—3 time series for each state using economic indicators from the St. Louis Federal Reserve (FRED) website. We build an API to extract the data and add our own indicators that we think will influence the future. At the time that this video is published, the country is experiencing a recession from the COVID-19 pandemic. Therefore, we will extract the recession indicator from the FRED website and make assumptions about how long the recession will last. Using this information, we create an economic outlook for each state. These forecasts can then be used to see which states we expect to recover most quickly from the recession.

This modeling process will be done in Python on a Jupyter Notebook, so it's a good idea to have Anaconda installed on your computer so you can follow along. The rpy2 library from Python will be utilized, so having R installed in your local environment is necessary.

What You Will Learn
  • Create classes in Python
  • Make predictions with machine learning and common forecasting models
  • Manipulate data with Pandas
  • Store data in base Python structures (lists, dictionaries)
  • Create APIs and visual aids 
Who This Book Is For 
Data scientists with experience who are looking to take their forecasting skills to the next level.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Watch now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Machine Learning for Economics and Finance in TensorFlow 2: Deep Learning Models for Research and Industry

Machine Learning for Economics and Finance in TensorFlow 2: Deep Learning Models for Research and Industry

Isaiah Hull

Publisher Resources

ISBN: 9781484268933