A friend of mine answered on this question in different social media on different language, I'll post his answer here:
1. scaler should be saved in this case.
You do fit_transform in the example the second time you run it, but you should just transform. Scaler should be "fit" once on data train and not change it afterwards. Then you will get 5 in ...
you need to define how many time steps you want to have in each time series block.
then for each unique patient, you need to create these blocks so the training set going to be a 3D matrix, and the dimensions are:
number of blocks * number of time steps * number of features
in addition to time series data, you can also add another head to feed NN with the ...
Conceptually, the sound of dropping a metal chain on the floor is different from the sound of dropping the separated links of that chain.
In a feed forward neural network all of sequential features would be consumed independently:
This is all good, as far as you’re ready to sacrifice the step-wise dependency ...
You don't need to do the n-gram creation for an RNN like you're showing. The point of Neural Language modeling with RNN/LSTM is to avoid having to make the Markov assumptions you state. To use an RNN, you just feed the whole sentence as-is to the RNN as a sequence, and as a target, you feed a sequence with each word from the input shifted one to the right.
I am not sure this type of model is a good use case for the particular task. More specifically, citing Chollet from Deep Learning with Python book,
Always remember that when it comes to markets, past performance is not a good predictor of future returns—looking in the rear-view mirror is a bad way to drive. Machine learning, on the other hand, is applicable ...
The last number 40 has nothing to do with the sequence length, its a hyper-parameter setting that is basically the length of the vector 'representation' of each token in the sequence. In this case , its 40 length. If you set it to 40 and use input embeddings of input 300-dimension (common if Glove), then the 300-dimensional word gets mapped to a 40-...
Of course that all weights are the same, but the update applied to the weights has a contribution from each of the timesteps, and the contribution associated with the first timesteps is what is more affected by the vanishing gradient problem.
50% is quite decent because you have five labels and random guessing model would have achieved only 20% accuracy. So you know your model is learning something.
The other thing you want to check out is whether this is suited to be a regression problem more than classification. For e.g, misclassifying a 5 (ground truth) into a 4 is better than misclassifying ...
It's not severe overfitting. So, here is my suggestions:
1- Simplify your network! Maybe your network is too complex for your data. If you have a small dataset or features are easy to detect, you don't need a deep network.
2- Add Dropout layers.
3- Use weight regularization. Here is the link for further information: