Hierarchical Time Series Forecasting with Python

Hierarchical forecasting is a method of forecasting time series data where the data is divided into multiple levels of aggregation. The levels can be thought of as a tree-like structure, where each level represents a different aggregation of the data. For example, the top level might represent total sales for a company, while the next level down might represent sales for each region, and the level below that might represent sales for each store within each region....

March 13, 2023 · 11 min · Mario Filho

Multi-Step Time Series Forecasting In Python

In this tutorial, I will explain two (and a half) methods to generate multi-step forecasts using time series data. They are the recursive or autoregressive method, the direct method, and a variant of the direct method with a single model. Table of Contents Preparing the Data Recursive Or Autoregressive Method In Pure Python Recursive Or Autoregressive Method With SKForecast Direct Method Direct Method With SKForecast Direct Method With a Single Model Direct Method With Horizon As A Feature Which Multi-Step Forecasting Method Is Best?...

March 7, 2023 · 8 min · Mario Filho

Differencing Time Series In Python With Pandas, Numpy, and Polars

When working with time series data, differencing is a common technique used to make the data stationary. Stationary data is important because it allows us to apply statistical models that assume constant parameters (like the mean and standard deviation) over time, and this can improve the accuracy of our predictions. Let’s see how we can easily perform differencing in Python using Pandas, Numpy, and Polars. Table of Contents First-order Differencing Pandas Numpy Polars Second-order Differencing Pandas Numpy Polars Seasonal Differencing Pandas Numpy Polars Log Differencing Pandas Numpy Polars Grouped Time Series Differencing Pandas Polars Fractional Differencing First-order Differencing First-order differencing involves subtracting each value in the time series from its previous value....

March 4, 2023 · 8 min · Mario Filho

Gaussian Process For Time Series Forecasting In Python

In this article, we will explore the use of Gaussian Processes for time series forecasting in Python, specifically using the GluonTS library. GluonTS is an open-source toolkit for building and evaluating state-of-the-art time series models. One of the key benefits of using Gaussian Processes for time series forecasting is that they can provide probabilistic predictions. Instead of just predicting a point estimate for the next value in the time series, GPs can provide a distribution over possible values, allowing us to quantify our uncertainty....

March 3, 2023 · 11 min · Mario Filho

Kalman Filter for Time Series Forecasting in Python

The Kalman Filter is a state-space model that estimates the state of a dynamic system based on a series of noisy observations. It uses a feedback mechanism called the Kalman gain to adjust the weight given to predicted and observed values based on their relative uncertainties. It has been widely used in various fields such as finance, aerospace, and robotics. In this tutorial, you will learn how to easily use the Kalman Filter for time series forecasting in Python....

March 2, 2023 · 8 min · Mario Filho

Multiple Time Series Forecasting With LightGBM In Python

Today, we’re going to explore multiple time series forecasting with LightGBM in Python. If you’re not already familiar, LightGBM is a powerful open-source gradient boosting framework that’s designed for efficiency and high performance. It’s a great tool for tackling large datasets and can help you create accurate predictions in a flash. When combined with the MLForecast library, it becomes a versatile and scalable solution for multiple time series forecasting. Let’s dive into the step-by-step process of preparing our data, defining our LightGBM model, and training it using MLForecast in Python....

February 28, 2023 · 10 min · Mario Filho

Multiple Time Series Forecasting With XGBoost In Python

Forecasting multiple time series can be a daunting task, especially when dealing with large amounts of data. However, XGBoost is a powerful algorithm that has been shown to perform exceptionally well in time series forecasting tasks. In combination with MLForecast, which is a scalable and easy-to-use time series forecasting library, we can make the process of training an XGBoost model for multiple time series forecasting a breeze. Let’s dive into the step-by-step process of preparing our data, defining our XGBoost model, and training it using MLForecast in Python....

February 28, 2023 · 10 min · Mario Filho

Multivariate Time Series Forecasting in Python

In this article, we’ll explore how to use scikit-learn with mlforecast to train multivariate time series models in Python. Instead of wasting time and making mistakes in manual data preparation, let’s use the mlforecast library. It has tools that transform our raw time series data into the correct format for training and prediction with scikit-learn. It computes the main features we want when modeling time series, such as aggregations over sliding windows, lags, differences, etc....

February 25, 2023 · 11 min · Mario Filho

Multiple Time Series Forecasting With Holt-Winters In Python

In today’s article, we’re going to explore the ins and outs of training a Holt-Winters model for forecasting multiple time series in Python. Holt-Winters is a very popular forecasting algorithm that can capture seasonality and trends in time series data through exponential smoothing. I’ll use StatsForecast, a scalable and easy-to-use Python library that can help you train a Holt-Winters model quickly and efficiently. You don’t need to be a programming wizard to get started with this library, and it can save you hours of coding time....

February 24, 2023 · 6 min · Mario Filho

Multiple Time Series Forecasting with DeepAR in Python

In this post, we will learn how to use DeepAR to forecast multiple time series using GluonTS in Python. DeepAR is a deep learning algorithm based on recurrent neural networks designed specifically for time series forecasting. It works by learning a model based on all the time series data, instead of creating a separate model for each one. In my experience, this often works better than creating a separate model for each time series....

February 23, 2023 · 10 min · Mario Filho