poypoyan / edhsmm

An(other) implementation of Explicit Duration Hidden Semi-Markov Models in Python 3
MIT License
8 stars 3 forks source link
cython em-algorithm hidden-markov-model hidden-markov-models hsmm machine-learning notebooks probabilistic-graphical-models python

Update (24-05-2024): As I am unable to maintain this repo, I am planning to archive this. If you are reading this, I already deleted the pip package edhsmm. Thank you for your understanding and showing interest with this project!

Warning: I made this repo when I was an undergrad, but was not even part of my undergrad project. Correctness of implementation not guaranteed, so use at your own risk.

edhsmm

An(other) implementation of Explicit Duration Hidden Semi-Markov Models in Python 3

The EM algorithm is based on Yu (2010) (Section 3.1, 2.2.1 & 2.2.2), while the Viterbi algorithm is based on Benouareth et al. (2008).

The code style is inspired from hmmlearn and jvkersch/hsmmlearn.

Implemented so far

Dependencies

Installation & Tutorial

Via source:

pip install .

Test in venv:

Windows

git clone https://github.com/poypoyan/edhsmm.git
cd edhsmm
python -m venv edhsmm-venv
edhsmm-venv\Scripts\activate
pip install --upgrade -r requirements.txt
pip install .

Type python to run Python CLI, and type deactivate to exit the environment.

Linux

git clone https://github.com/poypoyan/edhsmm.git
cd edhsmm
python3 -m venv edhsmm-venv
source edhsmm-venv/bin/activate
pip install --upgrade -r requirements.txt
pip install .

Type python3 to run Python CLI, and type deactivate to exit the environment.

Note: Also run pip install jupyterlab matplotlib and then jupyter lab to install requirements to run notebooks and to run them, respectively.

For tutorial, see the notebooks. This also serves as some sort of "documentation".

Found a bug? Suggest a feature? Please post on issues.