Multivariate longitudinal classification using Random Forest Classifier As the title suggests, I have a multivariate longitudinal dataset (also called panel data). (I have over 100.000 observations. The time period is X years. This means that for every year I have the values of the same variables. So I can see how every variable fluctuates over these X years for a specific observation). It is a binary classification case. So the output is either 0 or 1. I was able to figure out how to do this in order to be able to feed it into deep learning models (RNN, LSTM, GRU, CNN) because you can specify it when define the shape of the data.
How did I structure my data for the DL models: The columns represented the variables, a row was added for each year and at the end of the last year was mentionned the 1 or 0 . Then again X rows for the next observation. Let's say you have 5 years of data for an observation, then you get 5 rows per observation. (-> timesteps = 5) I mainly got this from the following page: https://machinelearningmastery.com/how-to-develop-convolutional-neural-network-models-for-time-series-forecasting/ (go to title 'Multiple Input Series').
Now, I also want to test other machine learning methods like Random Forest ( AdaBoost, XGboost, ...) but I don't find anything useful in literature... Has someone suggestions on how to deal with the data in these cases? 
 A: I'm doing a similar problem in the healthcare setting. The original problem is actually survival analysis, however, I reframed it to a binary classification problem. My goal is to predict the probability of a patient dropping off in the following month based on the current month data.
My longitudinal dataset is like this: each patient has multiple rows corresponding to a particular time point, and I have some time-varying feature that try to capture this longitudinality, e.g., time-varying age or current_month period (if a patient has 12 rows, then the current_month column will have values [0,1,2,3,4,5,6,7,8,9,10,11]). And since the definition of my label is whether the patient drops out next month, only the last row will have label==1 and all previous rows will have label==0. I understand this will cause a high imbalance, upsampling/downsampling method like SMOTE is applied to deal with this imbalanced dataset. And then, I feed this dataset into any classification algorithm like XGB/LGB etc...
