user id | event | date | amount | duration(min) |
124556. login 02/23. N/A. 23.
124556. withdrawal 02/28. 500 2.
124556. login 03/02. N/A. 12.
124556. p2p 03/03. 234 3.
124556. p2p 03/12. 213 1.
124556. deposit 03/23. 511 5.
I am currently trying to use transformer for classification problem.Above is the sample dataframe.I want to encode the event column and convert the dataframe into a time series data.
I want to preserve the time order for each event while keeping the 'amount' and 'duration' columns, but not all events have corresponding 'amount' values. For example, when the event is 'login', the corresponding 'amount' is null. How can I preserve the null values? Can Transformer handle the null values?
Transformers are not designed to handle tabular data with null values like in your scenario. Apply preprocessing to handle missing values.
For maintaining time order, you would have to convert your data into sequence like format.