jmschrei / yahmm

Yet Another Hidden Markov Model repository.
MIT License
249 stars 32 forks source link

Cannot read models with Multivariate Distributions. #46

Open nootanghimire opened 8 years ago

nootanghimire commented 8 years ago

I don't know if the problem is in reading the files or writing. The sample file after writing looks something like this:

zero 5
139840366077272 10611008 1.0 MultivariateDistribution(<map object at 0x7f2f1f1f1a20>)
139840366077416 10611008 1.0 MultivariateDistribution(<map object at 0x7f2f1f1f1828>)
139840366077560 10611008 1.0 MultivariateDistribution(<map object at 0x7f2f1f1f1a20>)
139840366026400 zero-end 1.0 None
139840366024888 zero-start 1.0 None
10611008 10611008 0.9894736842105722 0.3 139840366077272 139840366077272
10611008 10611008 0.010526315789427733 0.7 139840366077272 139840366077416
10611008 10611008 1.8680545612364728e-20 0.4 139840366077416 139840366077416
10611008 10611008 1.0 0.6 139840366077416 139840366077560
10611008 zero-end 0.016666666666564085 0.55 139840366077560 139840366026400
10611008 10611008 0.9833333333334359 0.45 139840366077560 139840366077560
zero-start 10611008 1.0 1.0 139840366024888 139840366077272

And the error I get while using model = Model.read(<file_stream>) is

Traceback (most recent call last):
  File "test_recording.py", line 197, in <module>
    model[i].read(filestream)
  File "yahmm/yahmm.pyx", line 3837, in yahmm.yahmm.Model.read (yahmm/yahmm.c:60161)
  File "yahmm/yahmm.pyx", line 2018, in yahmm.yahmm.State.read (yahmm/yahmm.c:32384)
  File "<string>", line 1
    State( MultivariateDistribution(<map object at 0x7f2f1f1f1a20>), name='10611008', weight=1.0, identity='139840366077272' )
                                    ^
jmschrei commented 8 years ago

You should switch over to pomegranate. I stopped development of yahmm a few years ago. Everything is way faster in pomegranate anyway!