Hi, I want to create a feature that counts the day...
# mlforecast
m
Hi, I want to create a feature that counts the days of since last non-zero. Currently I'm creating the feature manually using pandas and I realized that I can't use it on MLForecast when forecasting. In production, We will not have test data, thus we don't the data of the latest days value. I think that I need to create a lag transform so that MLForecast can help put the values in
X_df
automatically when doing
predict
. My question is: • Is the statement correct that this can be handled by MLForecast on
predict
if it is defined in lag_transform? • Can njit in lag transform used to do something like this?
j
hey. yes, you can write your logic in a function decorated with njit and provide that through lag_transforms, that will take care of computing the feature and updating it during predict
m
All right, thank you for the answer!