This message was deleted.
# neural-forecast
s
This message was deleted.
c
Hi @Signe Byrith! 1. Do you mean that we do not split the data? Doing proper splits is crucial to correctly evaluate models. The data split is done internally by the
fit
or
cross_validation
method. Simply specify
val_size
and
test_size
(or
n_windows
). See Section 5 of the tutorial. The purpose of the first part is to simply show how to train models. 2. Yes, is the
hidden_size
of the LSTM cell. 3. The loss defines the train loss to optimize and update the weights with gradient descent. You can also modify the
valid_loss
parameter of the
AutoLSTM
if you want a different validation loss than the train loss. 4. In cross validation you produce multiple forecasts starting at different timestamps. See image below. The cutoff specifies the last tiemestamp before each window of forecasts starts. So for the plot below cutoffs for each window are t_0, t_2, and t_4.
s
Hi Christian! thank you for the response - It is just when I look at the "End to End walkthrough" and the "usage example" of the LSTM under the API reference, in the "usage example" you explicit make a Y_train_df and Y_test_df, and was wondering which method i should use
c
If you want to recover predictions for a test set for evaluation,
cross_validation
is the easiest method 🙂
✅ 1
s
great thank you!
✅ 1
m
Hi @Cristian (Nixtla) , I step into this answer: in the documentation (https://nixtlaverse.nixtla.io/neuralforecast/core.html) and in the pip version I use it seems to me the parameter "test_size" is not available in fit method for the NHITS model, but only "val_size": does it make sense? are they considered equivalently here? Moreover I have a probably related exception error using predict_insample:
test_size - h
should be module `step_size`: in which method shall I have to set the test_size? Thanks! P.S. is it perhaps because I create the model like that? models=[NHITS(h=30,input_size=90,max_steps=100)] nf=NeuralForecast(models=models,freq='B') nf.fit(df=df_train, test_size=30)?
c
Hi! The test size is not available in the fit method, because its only purpose is to fit the model. To make predictions on the test set use the
cross_validation
method.
The
predict_insample
method is internally specifying the entire length of the series as the "test_size". We currently have a limitation that
test_size-h
(
length - h
in this case) must be module of
step_size
, to avoid having forecasts past the last date. You will need to trim the time series slightly to account for this.
m
great thank you!