Questions tagged [hmmlearn]

hmmlearn is a scikit-learn offspring implementing unsupervised learning and inference in Hidden Markov Models.

hmmlearn is a scikit-learn offspring implementing unsupervised learning and inference in Hidden Markov Models.

130 questions
0
votes
2 answers

Why I get different values everytime I run the function hmmlearn.hmm.GaussianHMM.fit()

I have a program. n = 6 data=pd.read_csv('11.csv',index_col='datetime') volume = data['TotalVolumeTraded'] close = data['ClosingPx'] logDel = np.log(np.array(data['HighPx'])) - np.log(np.array(data['LowPx'])) logRet_1 =…
inaMinute
  • 553
  • 2
  • 7
  • 16
0
votes
1 answer

Error in model prediction using hmmlearn

Hi I have a dataframe test, I am trying to predict using a Gaussian HMM with hmmlearn. When I do this: y = model.predict(test) y I get the hmm working fine producing and array of states however if i do this: for i in range(0,len(test)): y =…
azuric
  • 2,679
  • 7
  • 29
  • 44
0
votes
1 answer

hmmlearn doesn't converge on a simple input

import numpy as np from hmmlearn.hmm import MultinomialHMM startprob_prior = np.array([0.5, 0.5]) # guess transmat_prior = np.array([[0.9, 0.1], [0.3, 0.7]]) # guess #data is binary, 0\1 with bursts of 1's x =…
Hanan Shteingart
  • 8,480
  • 10
  • 53
  • 66
0
votes
1 answer

HMMlearn GMMHMM error

I am trying to initialize several GMM's for use with the GMMHMM's gmms_ attribute. Each GMM instance has a different mean, weight and co-variance and serves as a component of a 5-component mixture for the GMMHMM. The mean, weight and co-variance are…
Dider
  • 367
  • 1
  • 3
  • 17
0
votes
1 answer

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

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?
Dider
  • 367
  • 1
  • 3
  • 17
0
votes
1 answer

missing data in hmmlearn from scikit-learn

i'm running a simple HMM using scikit-learn's hmmlearn module. it works for fully observed data, but it fails when i pass it observations with missing data. small example: import numpy as np import hmmlearn import hmmlearn.hmm as hmm transmat =…
mvd
  • 1,167
  • 3
  • 18
  • 30
0
votes
1 answer

python GMMHMM clarification

I am reading about gaussian mixture hmms and I want to implement one. I am using the hmmlearn package and I know it has been deprecated from scikit-learn. In the documentation it says that in the GMMHMM constructor it requires: "gmms (array of GMM…
notArefill
  • 786
  • 1
  • 11
  • 27
-1
votes
1 answer

Hidden Markov package in Python or R

I want to build a Hidden Markov model (HMM), that must contain these properties: More than one subject need to be fitted, because I make use of panel/longitudinal data Discrete distributions Multivariate output/emission The transition…
-1
votes
1 answer

Numpy error in hmmlearn

I am using hmmlearn library to create HMM. While running the code it gave an error ttributeError: 'module' object has no attribute 'broadcast_to'. I am running GMMHMM as model1 = GMMHMM(n_components=4, n_mix=64, covariance_type='diag',…
shaifali Gupta
  • 380
  • 1
  • 4
  • 16
-2
votes
2 answers

Fit function hmmlearn doesn't work: fit() takes 2 positional arguments but 3 were given

I am trying to run a hidden markov model, however the fit function doesn't work properly. Code: import numpy as np from hmmlearn import hmm X1 = [[0.5], [1.0], [-1.0], [0.42], [0.24]] X2 = [[2.4], [4.2], [0.5], [-0.24]] X = np.concatenate([X1,…
1 2 3
8
9