Demand Forecasting with Holiday Detection and Featurization
In this notebook, we’ll demonstrate how to use Azure Machine Learning’s automated machine learning (AutoML) for time-series forecasting, with a focus on handling holidays and creating custom features.
Prepare Data
We’ll start by loading the bike share demand data into an MLTable, which is the required format for AutoML forecasting jobs. We’ll also add a ‘holiday’ column to the data, which will be used later for feature engineering.
import pandas as pd
from azure.ai.ml import Input
from azure.ai.ml.constants import AssetTypes
# Load the bike share demand data
df = pd.read_csv('bike_share_demand.csv', index_col='date', parse_dates=['date'])
# Add a 'holiday' column
df['holiday'] = df.index.isin(pd.DatetimeIndex(['2017-01-02', '2017-05-29', '2017-07-04', '2017-09-04', '2017-11-23', '2017-12-25']))
# Create an MLTable from the data
my_training_data_input = Input(
type=AssetTypes.MLTABLE,
path="./bike_share_data