I want to build an LSTM model for customer behaviour. It's the first time for me working on a timeseries, so some concepts are not clear to me at all.
My prediction problem is multidimensional, meaning that I also want to predict many informations associated to an action for each customer.
The dataset is currently shaped as a list of 2d padded arrays of one-hot encoded features (customer actions + other informations), for example:
customer_id encoded_features 0 25464205 [[0,1,0],..,[1,1,1],[1,0,1],..,[1,0,1]] 1 56456574 [[0,1,1],..,[1,0,1],[1,0,1],..,[1,1,1]]
where each element in the encoded_features entries represents a specific timestep.
My idea here is to use keras input shape
(n. customers, n. timesteps, length of features encoding)
In the example above it would be
I have two main questions:
Is this whole setting rigth for the prediction of next single customer action? I would like to simply give a new sequence of features for a certain customer and predict all features in the next timestep.
I am thinking about splitting the data (according to a certain ratio) into sequential training and test sets, in order to test the trained model on unseen feature vectors. In the example above it would be:
customer_id X_train y_train 0 25464205 [[0,1,0],..] [1,1,1] 1 56456574 [[0,1,1],..] [1,0,1] customer_id X_test y_test 0 25464205 [[1,0,1],..] [1,0,1] 1 56456574 [[1,0,1],..] [1,1,1]
Notice that X_train and X_test will generally contain all Train/Test events, except for the last one which has to be predicted. Is this a correct interpretation?