Forecaster
CINNForecaster
Conditional Invertible Neural Network (cINN) Forecaster.
Quickstart
python
from sktime.forecasting.cinn import CINNForecaster
estimator = CINNForecaster(n_coupling_layers=10, hidden_dim_size=32, sample_dim=24, batch_size=64, encoded_cond_size=64, lr=0.0005, weight_decay=1e-05, sp_list=None, fourier_terms_list=None, window_size=720, num_epochs=50, verbose=False, f_statistic=None, init_param_f_statistic=None, deterministic=False, lag_feature='mean', patience=5, delta=0.0001, val_split=0.2)Parameters(19)
- n_coupling_layersint, optional (default=15)
- Number of coupling layers in the cINN.
- hidden_dim_sizeint, optional (default=64)
- Number of hidden units in the subnet.
- sample_dimint, optional (default=24)
- Dimension of the samples that the cINN is creating
- batch_sizeint, optional (default=64)
- Batch size for the training.
- encoded_cond_sizeint, optional (default=64)
- Dimension of the encoded condition.
- lrfloat, optional (default=5e-4)
- Learning rate for the Adam optimizer.
- weight_decayfloat, optional (default=1e-5)
- Weight decay for the Adam optimizer.
- sp_listlist of int, optional (default=[24])
- List of seasonal periods to use for the Fourier features.
- fourier_terms_listlist of int, optional (default=[1, 1])
- List of number of Fourier terms to use for the Fourier features.
- window_sizeint, optional (default=24*30)
- Window size for calculating the rolling statistics using the WindowSummarizer.
- lag_feature: str, optional (default=”mean”)
- The rolling statistic that the WindowSummarizer should calculate.
- num_epochsint, optional (default=50)
- Number of epochs to train the cINN.
- verbosebool, optional (default=False)
- Whether to print the training progress.
- f_statisticfunction, optional (default=default_sine)
- Function to use for forecasting the rolling statistic.
- init_param_f_statisticlist of float, optional (default=[1, 0, 0, 10, 1, 1])
- Initial parameters for the f_statistic function.
- deterministicbool, optional (default=False)
- Whether to use a deterministic or stochastic cINN. Note, deterministic should only used for testing.
- patienceint, optional (default=5)
- Number of epochs to wait before stopping the training.
- deltafloat, optional (default=0.0001)
- Minimum change in the validation loss to consider as an improvement.
- val_splitfloat, optional (default=0.2)
- Fraction of the data to use for validation.
Examples
>>> from sktime.forecasting.cinn import CINNForecaster
>>> from sktime.datasets import load_airline
>>> y = load_airline ()
>>> model = CINNForecaster (window_size = 100)
>>> model. fit (y) CINNForecaster(
... )
>>> y_pred = model. predict (fh = [1, 2, 3 ])References
- ..[1] Heidrich, B., Hertel, M., Neumann, O., Hagenmeyer, V., & Mikut, R. (2023). Using conditional Invertible Neural Networks to Perform Mid- Term Peak Load Forecasting. IET Smart Grid, Under Review