Skip to content
المشاريع

trainindata/forecasting-with-machine-learning

عرض على GitHub

حول

Code repository for the course "Forecasting with Machine Learning Models"

التعلّم والتعليم

كيف تُقاس هذه الأرقام

النمو المقاس للنجوم

خلال 24 ساعة
٠
خلال 7 أيام
٠
خلال 15 يومًا
٠
خلال شهر
جارٍ جمع السجل

تغيّر صافي النجوم خلال فترات متداخلة، وليس مجموعًا يوميًا. تبقى القياسات المفقودة فارغة. النجوم تقيس الاهتمام لا جودة البرمجيات.

README.md

الأصل

Python License: BSD Powered by Train in Data

Forecasting with Machine Learning

Learn how to forecast time series with machine learning models: from turning time series into tabular data, to single-step and multistep forecasting, multiseries forecasting, backtesting, and error metrics.

This repository contains the practical notebooks for the Forecasting with Machine Learning course. The examples use pandas 3, scikit-learn, Feature-engine, and skforecast.

Released: March 2024

Last updated: Nov 2026

Status: Actively maintained

Forecasting with Machine Learning

What you will learn

  • Frame time series forecasting as a regression problem.
  • Tabularize time series with lag, window, and datetime features.
  • Build benchmark models to know whether machine learning is adding value.
  • Forecast multiple steps ahead with recursive and direct strategies.
  • Forecast many time series at once with global models.
  • Evaluate forecasting models with backtesting and choose the right error metric.

Course contents

  1. Forecasting as regression

    • Time series forecasting
    • Tabularizing time series: lag, window, and datetime features
    • Endogenous and exogenous variables
    • Feature engineering with Feature-engine
    • Benchmark models: naive, seasonal naive, moving average
    • Single-step forecasting with machine learning
  2. Multistep forecasting

    • Recursive forecasting
    • Recursive forecasting with window features and future-known features
    • Direct forecasting with skforecast and scikit-learn
    • Direct forecasting with future-known features
  3. Multiseries forecasting

    • Global vs local forecasting
    • Independent multi-time series forecasting
    • Dependent multi-time series forecasting
  4. Backtesting

    • Backtesting with or without refitting
    • Backtesting with expanding or rolling training windows
    • Backtesting with intermittent refitting
    • Backtesting with a gap
  5. Error metrics

    • Choosing error metrics for forecasting
    • Implementing and using custom error metrics

Getting started

Clone the repository (Python 3.12+ required), then set up a dedicated environment to run the notebooks.

Create and activate a virtual environment

python -m venv fwml
source fwml/bin/activate        # macOS/Linux
fwml\Scripts\activate           # Windows

Install dependencies

pip install -r requirements.txt

Install Jupyter and register the kernel

pip install jupyter ipykernel
python -m ipykernel install --user --name=fwml --display-name "fwml"

The environment will now be available as a kernel named fwml in Jupyter Notebook. Start Jupyter and open the notebooks in numerical order:

jupyter notebook

Course

For lectures, explanations, and the complete learning path, visit the online course.

استكشف مشاريع مشابهة ومرتبطة

جارٍ التحميل…