Giter Site home page Giter Site logo

poypoyan / edhsmm Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 3.0 223 KB

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

License: MIT License

Python 23.79% Jupyter Notebook 65.51% Cython 10.70%
machine-learning probabilistic-graphical-models em-algorithm python cython hsmm notebooks hidden-markov-model hidden-markov-models

edhsmm's Introduction

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

  • EM algorithm
  • Scoring (log-likelihood of observation under the model)
  • Viterbi algorithm
  • Generate samples
  • Support for multivariate Gaussian emissions
  • Support for multiple observation sequences
  • Support for multinomial (discrete) emissions

Dependencies

  • python >= 3.6
  • numpy >= 1.17
  • scikit-learn >= 0.16
  • scipy >= 0.19

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.