hmmlearn

HMMlearn Gaussian Mixture: set mean, weight and variance of each mixture component

时间秒杀一切 提交于 2021-02-08 10:33:53
问题 I am using the HMMlearn module to generate a HMM with a Gaussian Mixture Model. The problem is I want to initialize the mean, variance and weight of each mixture component before I fit the model to any data. How would I go about doing this? 回答1: From the HHMlean documentation Each HMM parameter has a character code which can be used to customize its initialization and estimation. EM algorithm needs a starting point to proceed, thus prior to training each parameter is assigned a value either

Decoding sequences in a GaussianHMM

随声附和 提交于 2021-02-06 15:18:58
问题 I'm playing around with Hidden Markov Models for a stock market prediction problem. My data matrix contains various features for a particular security: 01-01-2001, .025, .012, .01 01-02-2001, -.005, -.023, .02 I fit a simple GaussianHMM: from hmmlearn import GaussianHMM mdl = GaussianHMM(n_components=3,covariance_type='diag',n_iter=1000) mdl.fit(train[:,1:]) With the model (λ), I can decode an observation vector to find the most likely hidden state sequence corresponding to the observation

Decoding sequences in a GaussianHMM

蹲街弑〆低调 提交于 2021-02-06 15:18:22
问题 I'm playing around with Hidden Markov Models for a stock market prediction problem. My data matrix contains various features for a particular security: 01-01-2001, .025, .012, .01 01-02-2001, -.005, -.023, .02 I fit a simple GaussianHMM: from hmmlearn import GaussianHMM mdl = GaussianHMM(n_components=3,covariance_type='diag',n_iter=1000) mdl.fit(train[:,1:]) With the model (λ), I can decode an observation vector to find the most likely hidden state sequence corresponding to the observation

Decoding sequences in a GaussianHMM

删除回忆录丶 提交于 2021-02-06 15:17:34
问题 I'm playing around with Hidden Markov Models for a stock market prediction problem. My data matrix contains various features for a particular security: 01-01-2001, .025, .012, .01 01-02-2001, -.005, -.023, .02 I fit a simple GaussianHMM: from hmmlearn import GaussianHMM mdl = GaussianHMM(n_components=3,covariance_type='diag',n_iter=1000) mdl.fit(train[:,1:]) With the model (λ), I can decode an observation vector to find the most likely hidden state sequence corresponding to the observation

Error compiling C code for python hmmlearn package

允我心安 提交于 2019-12-24 05:52:40
问题 I'm having some trouble getting the hmmlearn package to install properly (in a virtual environment); it seems to have something to do with the underlying C code. The package installs fine with pip , but when I try to import the core class, I get an error: In [1]: import hmmlearn In [2]: from hmmlearn import hmm --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-8b8c029fb053> in <module>() ----> 1 from

Error compiling C code for python hmmlearn package

旧巷老猫 提交于 2019-12-24 05:50:15
问题 I'm having some trouble getting the hmmlearn package to install properly (in a virtual environment); it seems to have something to do with the underlying C code. The package installs fine with pip , but when I try to import the core class, I get an error: In [1]: import hmmlearn In [2]: from hmmlearn import hmm --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-2-8b8c029fb053> in <module>() ----> 1 from

Python: passing multiple LARGE sequences through hmmlearn

旧时模样 提交于 2019-12-13 07:37:16
问题 So I am trying to train a very large feature array for hidden markov model: 700 x (400 x 4122), where each 400x4122 mini-array is a sequence of observed samples across 400 time stamps with 4122 features. There is a total of 700 such sequences, which amounts to ~45GB of memory, when concatenated. My question is: how do you work with array of this size? In the hmmlearn python package, one typically work with multiple sequences as follows: x1 -> a 400x4122 sequence x2 -> another 400x4122

how to run hidden markov models in Python with hmmlearn?

╄→尐↘猪︶ㄣ 提交于 2019-12-04 13:34:15
问题 This question was migrated from Cross Validated because it can be answered on Stack Overflow. Migrated 3 years ago . I tried to use hmmlearn from GitHub to run a binary hidden markov model. This does not work: import hmmlearn.hmm as hmm transmat = np.array([[0.7, 0.3], [0.3, 0.7]]) emitmat = np.array([[0.9, 0.1], [0.2, 0.8]]) obs = np.array([0, 0, 1, 0, 0]) startprob = np.array([0.5, 0.5]) h = hmm.MultinomialHMM(n_components=2, startprob=startprob, transmat=transmat) h.emissionprob_ = emitmat

celery 'Worker-n' pid:xxxx exited with 'exitcode 1' when I import hmmlearn

寵の児 提交于 2019-12-01 05:18:39
问题 In my tasks.py file, when I import hmmlearn, from hmmlearn import hmm and start my celery workers, I get the following error [2017-06-14 09:18:27,638: INFO/MainProcess] Received task: sm.tasks.mytask[4e46806e-6f0f-420f-baac-c727c2a382d4] [2017-06-14 09:18:27,716: ERROR/MainProcess] Process 'Worker-4' pid:5264 exited with 'exitcode 1' [2017-06-14 09:18:29,857: ERROR/MainProcess] Process 'Worker-7' pid:3172 exited with 'exitcode 1' [2017-06-14 09:18:29,857: ERROR/MainProcess] Process 'Worker-6'