https://github.com/nixtla logo
#neural-forecast
Title
# neural-forecast
s

Silas Klug

10/17/2023, 11:00 AM
Hi everybody, I have an issue with the exclude_insample_y flag. I want to train a model that predicts y, given past and future values of a vector X (excluding y). As a starting point I'm using this example. I created two additional columns called 'x1' and 'x2', that are both linearly related to y. Therefore it should be easy for the model to predict with those external variables:
Copy code
models = [NBEATS(h=h,input_size=7,
                loss=DistributionLoss(distribution='Poisson', level=[90]),
                max_steps=100,
                scaler_type='standard',
                hist_exog_list=['x1','x2'],
                exclude_insample_y = True)]
However, I cannot predict without feeding y:
p = model.predict(train[['ds','unique_id','x1','x2']])
Also, when I set y to zero, it gives a different result to when I don't. It seems like y is still used for prediction, although it should be excluded.
c

Cristian (Nixtla)

10/17/2023, 3:36 PM
Hi @Silas Klug! You still need to pass the
y
because this is the target variable you are training to predict. Can you give us more information of your use case?
s

Silas Klug

10/17/2023, 3:56 PM
Hi Cristian, thanks for the quick response 🙂 I'm using y for training, but I want to leave it out during prediction. Ultimately, I want to predict (nowcast) a variable y based on some other variables X (and their past values). In the first step I want to be sure, y is really not used for prediction.
c

Cristian (Nixtla)

10/17/2023, 4:42 PM
Got it, yes you are refering to the predict method. I will check what is happening, the values of
y
should not affect the outcome
s

Silas Klug

11/02/2023, 9:33 AM
Hi @Cristian (Nixtla), do you already have an idea what could be the issue?
c

Cristian (Nixtla)

11/04/2023, 7:40 PM
@José Morales can you check this please?
👀 1
j

José Morales

11/06/2023, 4:11 PM
Hey @Silas Klug, this seems to be an issue with the scaling. If you remove the scaling you'll get the same predictions by passing y as zeros or the original values. I'll investigate it further