I'm guessing this is not possible, at least with the standard HMM implementation of scikit-learn, but I wanted to ask this question to see if there are any other approaches to this issue.
The problem is basically that I want to use a hidden markov model to fit some set of observations sequences; however, the observations I have are not always aligned to the same time step. So for instance, I might have two sequences that I want to use for fitting like:
obs1 = [1,2,3,4]
obs2 = [1,2,2,4]
However, these are not necessarily evenly spaced in time. So it might be that say the observations in obs1
were observed at times 1,2,3,6
, and the observations in obs2
were observed at times 1,4,5,6
. Therefore it seems wrong to feed them into an HMM as is.
What I tried so far is "interpolating" the observations so that the time steps are the same. So the examples above would become:
obs1 = [1,2,3,3,3,4]
obs2 = [1,1,1,2,2,4]
This seems to work relatively well for my machine learning problem; however, it slows down the fitting considerably because of the large numbers of additional samples (the observations are relatively sparse so adding these interpolations adds hundreds of additional observations). Is there any other way to do it?