Predict Panel Data Model values with a LSTM network

34 Views Asked by At

I want to make predictions of how many mail postards are sent daily in every post office in my city. The problem seems easy, but I want to predict how many postcards are sent in each office and what type the postcards are.

Post Offices = [001, 002, 003]
Postcards Types = [A, B, C]
Prediction target = 'Amount'

An example of the data I have:

+----------------------+-------------+---------------+--------+--------------------+
| Date                 | Post office | Postcard type | Amount | Other vairables... |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 001         | A             | 23     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 001         | B             | 1      |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 001         | C             | 15     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 002         | A             | 44     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 002         | B             | 6      |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 002         | C             | 29     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 003         | A             | 15     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 003         | B             | 1      |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-01           | 003         | C             | 10     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-02           | 001         | A             | 25     |                    |
+----------------------+-------------+---------------+--------+--------------------+
| 2023-01-02           | 001         | B             | 3      |                    |
+----------------------+-------------+---------------+--------+--------------------+
| Rest of reigsters... |             |               |        |                    |
+----------------------+-------------+---------------+--------+--------------------+

I have worked with LSTM network but I don't know how to aproach this problem with an LSTM to generate one unique model. I have been searching but cant find a way of solving the problem because the model should predict the Amount for each office and each type (categorical variables). The model should distict that office 002 has much more traffic than office 001. My data is a Panel Data Model and there is not much information about this on the internet.

As a bonus: If anyone gets the solution, is there a way of automating this process of classification by categorical values? Imagine that I have a new variable "Delivery success" with values ["Delivery OK", "Delivery failure"] so that I can group them by ("Date", "Post office", "Postcard type" and "Delivery success"). How canI make a model that supports this feature?

0

There are 0 best solutions below