Extending fastai tabular model with LSTM component

I am facing a fairly interesting use-case.

I have daily sales data (data similar to Rossman dataset) where we have a lot of categorical variables (e.g. store, group_of_product, etc) and thus Entity Embeddings, which are already provided by fastai are awesome. There is one thing I am missing though.

As data are on daily basis and are technically a time series, we need to also start working with the concept of autocorrelation. We can either lag of the y and use it as a continuous regressor. However, I would like to extend the model with LSTM layers.

What is the best what to extend tabular_model without writing the entire model from scratch?

I think a lot of people would benefit from this as usual sales data are exactly of this nature - time component (lstm) and lot of hierarchies (embedings)

We can use example of course-v3/lesson6-rossmann.ipynb at master · fastai/course-v3 · GitHub

1 Like