This message was deleted.
# neural-forecast
s
This message was deleted.
c
Hi @Akmal Soliev 🙂. Yes, it should be possible to use the sales of a different
unique_id
to predict a new article (in fact, any model would work). However, the change should only be done during the
predict
step. My recommendations are: 1. Fit your model on the historical values of your existing shirts, as you would normally do. There is no need to change any
unique_id
. Do not change and group the different products in the same
unique_id
. Each
unique_id
should only have one value for each
ds
. 2. When using the
predict
method, pass a new
df
using the appropriate values for
y
from a different article. For instance, set the dates for the current year but take the values for
y
of the existing similar shirts from the previous year. (Of course, this approach is making many assumptions to work properly). Let me know if this is clear.
a
Yes, it should be possible to use the sales of a different
unique_id
to predict a new article
In this case if I have passed
blue shirt
red shirt
white shirt
as train unique id I'd still be able to predict
yellow shirt
? I think if there was a minimal example that would help a ton! Thanks Christian, struggling to wrap my head around this idea.
c
With neuralforecast models you can use a trained model to forecast any time series you want by simply passing a new
df
in the
predict
method. The
unique_id
of the
df
does not have to be contained in the train data. By training on
blue shirt
red shirt
white shirt
, etc. the model has learned to forecast multiple types of shirts. You can then construct your
df
for the predict method with a new
unique_id
, for example
yellow_shirt
, and take the
y
values of a "very similar" shirt. Or maybe produce multiple forecasts for several "very similar" shirts and then take the average/mean.
This related to transfer learning (for example here: https://nixtla.mintlify.app/neuralforecast/examples/transfer_learning.html). Note how we forecast AirPassengers data with a model trained on M4 by passing the
df
dataset in the
predict
method. Its the same principle
a
1. When using the
predict
method, pass a new
df
using the appropriate values for
y
from a different article. For instance, set the dates for the current year but take the values for
y
of the existing similar shirts from the previous year. (Of course, this approach is making many assumptions to work properly).
okay i literally just had to change the parameter 🤦, was so confused on why you said
df
😄 Does it work with exo variables? I attempted to run this on Airpassanger example from above with the following variation to
Y_test_df
:
Copy code
unique_id	    ds	        y	  trend	y_[lag12]
0	TestingAirlines	1960-01-31	417.0	132	360.0
1	TestingAirlines	1960-02-29	391.0	133	342.0
2	TestingAirlines	1960-03-31	419.0	134	406.0
3	TestingAirlines	1960-04-30	461.0	135	396.0
4	TestingAirlines	1960-05-31	472.0	136	420.0
I am getting the following error:
Copy code
Exception: {'airline1'} static exogenous variables not found in input dataset
c
Yes, it allows for exogenous. In the dataframe for the predict method you must include all variables added when taining
a
all features? If yes, then all features are identical. The only difference is the
unique_id
c
Yes, if you pass all the same features then the forecasts will be the same. You essentially assume, for example, the forecasts of the
yellow_shirt
will be identical to the
blue_shirt
. However, depending on your exogenous features you might have different behaviour (such as weather or number of people for the new year). Another option as I mentioned is to take some form of aggregation from multiple forecasts for different similar products (it has a k-nearest neighbor flavor).
a
I have attempted the first option, but it gives me an error :/ Second option is nice, will look into it after the first one
c
One last option is to leverage TFT's static_features in the encoder directly. You should first create several static features to characterize products (for example category, color, size, etc.). Then use static features + calendar variables to produce forecasts without past history.