# Download data# ==============================================================================url=('https://raw.githubusercontent.com/JoaquinAmatRodrigo/skforecast/master/data/h2o.csv')data=pd.read_csv(url,sep=',',header=0,names=['y','datetime'])# Data preprocessing# ==============================================================================data['datetime']=pd.to_datetime(data['datetime'],format='%Y/%m/%d')data=data.set_index('datetime')data=data.asfreq('MS')data=data['y']data=data.sort_index()# Split data in train snd backtest# ==============================================================================n_backtest=36*3# Last 9 years are used for backtestdata_train=data[:-n_backtest]data_backtest=data[-n_backtest:]
Number of observations used for training: 96
Number of observations used for backtesting: 108
Number of folds: 16
Number of steps per fold: 7
Last fold only includes 3 observations.