How should longitudinal data be inputted into a HMMmodel (I don't care if the package is seqlearn, hmmlearn, pomegranate,...)? All these packages don't have a proper documentation on how to input data where for each timestep there are multiple variables. Considering the change of these specific variables over
X timesteps it should be able to predict if it as a 1 or a 0 and it should be able to learn it by itself. I read that seqlearn is the best choice for this binary classification problem.
Until know I have seen formattings like this passing by:
X1 = [1, 2, 0, 1, 1] X2 = [42, 42]
where you have two 1D sequences and afterwards you can do:
X = np.append(X1, X2) lengths = [len(X1), len(X2)] X = np.array([1, 1, 0, -1, -1]) model = hmm.GaussianHMM(n_components=2, n_iter=100) model.fit(X.reshape(-1,1))
I don't succeed in formatting my longitudinal data in such a way that it can be read in because the example above is not panel data.
How should I arrange the