Hidden Markov Models in Python, with scikit-learn like API

Overview

hmmlearn

hmmlearn is a set of algorithms for unsupervised learning and inference of Hidden Markov Models. For supervised learning learning of HMMs and similar models see seqlearn.

Note: This package is under limited-maintenance mode.

Important links

Dependencies

The required dependencies to use hmmlearn are

  • Python >= 3.5
  • NumPy >= 1.10
  • scikit-learn >= 0.16

You also need Matplotlib >= 1.1.1 to run the examples and pytest >= 2.6.0 to run the tests.

Installation

Requires a C compiler and Python headers.

To install from PyPI:

pip install --upgrade --user hmmlearn

To install from the repo:

pip install --user git+https://github.com/hmmlearn/hmmlearn
Issues
  • Memory error : HMM for MFCC feautres

    Memory error : HMM for MFCC feautres

    I am trying to create audio vocabulary from MFCC features by applying HMM. Since I have 10 speakers in the MFCC features. I need 50 states per speaker. So I used N = 500 states and it throws Memory error, but it works fine with N =100 states.

    Memory Error is because of computational in efficiency of a machine or due to in proper initialization?

    Here is my code

    import numpy as np
    from hmmlearn import hmm
    import librosa
    import matplotlib.pyplot as plt
    
    def getMFCC(episode):
    
        filename = getPathToGroundtruth(episode)
    
        y, sr = librosa.load(filename)  # Y gives 
    
        data = librosa.feature.mfcc(y=y, sr=sr)
    
        return data
    
    def hmm_init(n,data):  #n = states d = no of feautures
    
        states =[]
    
        model = hmm.GaussianHMM(n_components=N, covariance_type="full")
    
        model.transmat_ = np.ones((N, N)) / N
    
        model.startprob_ = np.ones(N) / N
    
        fit = model.fit(data.T)
    
        z=fit.decode(data.T,algorithm='viterbi')[1]
    
        states.append(z)
    
        return states
    
    data_m = getMFCC(1)  # Provides MFCC features of numpy array [20 X 56829]
    
    N = 500
    
    D= len(data)
    
    states = hmm_init(N,data)
    
    In [23]: run Final_hmm.py
    ---------------------------------------------------------------------------
    MemoryError                               Traceback (most recent call last)
    /home/elancheliyan/Final_hmm.py in <module>()
         73 D= len(data)
         74 
    ---> 75 states = hmm_init(N,data)
         76 states.dump("states")
         77 
    
    /home/elancheliyan/Final_hmm.py in hmm_init(n, data)
         57     model.startprob_ = np.ones(N) / N
         58 
    ---> 59     fit = model.fit(data.T)
         60 
         61     z=fit.decode(data.T,algorithm='viterbi')[1]
    
    /cal/homes/elancheliyan/.local/lib/python3.5/site-packages/hmmlearn-0.2.1-py3.5-linux-x86_64.egg/hmmlearn/base.py in fit(self, X, lengths)
        434                 self._accumulate_sufficient_statistics(
        435                     stats, X[i:j], framelogprob, posteriors, fwdlattice,
    --> 436                     bwdlattice)
        437 
        438             # XXX must be before convergence check, because otherwise
    
    /cal/homes/elancheliyan/.local/lib/python3.5/site-packages/hmmlearn-0.2.1-py3.5-linux-x86_64.egg/hmmlearn/hmm.py in _accumulate_sufficient_statistics(self, stats, obs, framelogprob, posteriors, fwdlattice, bwdlattice)
        221                                           posteriors, fwdlattice, bwdlattice):
        222         super(GaussianHMM, self)._accumulate_sufficient_statistics(
    --> 223             stats, obs, framelogprob, posteriors, fwdlattice, bwdlattice)
        224 
        225         if 'm' in self.params or 'c' in self.params:
    
    /cal/homes/elancheliyan/.local/lib/python3.5/site-packages/hmmlearn-0.2.1-py3.5-linux-x86_64.egg/hmmlearn/base.py in _accumulate_sufficient_statistics(self, stats, X, framelogprob, posteriors, fwdlattice, bwdlattice)
        620                 return
        621 
    --> 622             lneta = np.zeros((n_samples - 1, n_components, n_components))
        623             _hmmc._compute_lneta(n_samples, n_components, fwdlattice,
        624                                  log_mask_zero(self.transmat_),
    
    MemoryError:
    
    
    opened by epratheeban 25
  • GMM -> GaussianMixture

    GMM -> GaussianMixture

    In sklearn GMM was replaced by GaussianMixture. See https://github.com/scikit-learn/scikit-learn/blob/master/sklearn/mixture/gmm.py:

    class GMM(_GMMBase): """ Legacy Gaussian Mixture Model .. deprecated:: 0.18 This class will be removed in 0.20. Use :class:sklearn.mixture.GaussianMixture instead. """

    However, hmmlearn still uses the old version. A pull request is needed to upgrade hmmlearn to work with the newer API.

    opened by chanansh 24
  • reduce memory consumption during GHMMHMM multi sequence fits

    reduce memory consumption during GHMMHMM multi sequence fits

    Hi, today I learned about your package, started to use it, faced the memory problem, and came up with a PR that fixes it.

    I've exploited the lengths option and added another meaning to it. Currently, for the GMMHMM only. Curious users will find a way to extend my implementation to other models as well.

    This also partially addresses the comment left in https://github.com/hmmlearn/hmmlearn/commit/08dee6640483cda232f7d2fcc7935d4008f4d368:

    https://github.com/hmmlearn/hmmlearn/blob/0562ca65756ffb60da836eeeb1845e61767c705b/lib/hmmlearn/hmm.py#L918-L922

    I got rid of the unnecessary 'centered' arrays in the stats dict. If you don't want to store the post_comp_mix matrices in the stats, the logic of computing intermediate variables - c_n and c_d for the covariance - should be moved from the _do_mstep to _accumulate_sufficient_statistics function. Since this is my first PR, I've decided not to rummage through your code a lot. In either case, this should be considered in a separate PR, if you will.

    Best, Danylo

    opened by dizcza 22
  • ImportError: cannot import name hmm

    ImportError: cannot import name hmm

    Hi,

    I used the hmm module from sklearn and tried to replace it by the hmmlearn module. Unfortunately I could not import it to my notebook.

    from hmmlearn import hmm --------------------------------------------------------------------------- ImportError Traceback (most recent call last) <ipython-input-7-8b8c029fb053> in <module>() ----> 1 from hmmlearn import hmm

    ImportError: cannot import name hmm

    I tried first pip-3.3 install git+https://github.com/hmmlearn/hmmlearn.git

    As this didn't work I cloned the project and run the setup.py (with python 3.3) but I still get an import error.

    If I try to import

    import hmmlearn.hmm

    I get another error

    ImportError Traceback (most recent call last) <ipython-input-8-8dbb2cfe75b2> in <module>() ----> 1 import hmmlearn.hmm

    /home/ipython/python/lib/python3.3/site-packages/hmmlearn/hmm.py in <module>() 22 from sklearn import cluster 23 ---> 24 from .utils.fixes import log_multivariate_normal_density 25 26 from . import _hmmc

    ImportError: No module named 'hmmlearn.utils'

    What did I do wrong?

    Cheers, Evelyn

    opened by metterlein 22
  •  probability would approach to 0 after several EM iterations

    probability would approach to 0 after several EM iterations

    When I used GaussianHMM().fit() to train HMM, there is a RuntimeWarning: divide by zero encountered in log. Then I found that the start probability would approach to 0 after several EM iterations. My question is how to avoid probability approaching to 0 ?

    opened by LinZzzzzzzzz 21
  • simple multinomial example

    simple multinomial example

    Hi there!

    Using the latest master of hmmlearn, I tried running a simple MultinomialHMM example (code below) that results in the following error:

    File "build/bdist.macosx-10.5-x86_64/egg/hmmlearn/base.py", line 307, in decode ValueError: could not broadcast input array from shape (6) into shape (1)

    Could you please tell me what i am doing wrong? My expectation is that applying Viterbi should give me the most probable hidden sequence. However passing a list of observation doesn't work unlike passing a single value which does.

    Thanks!

    Vlad

    from __future__ import division
    import numpy as np
    from hmmlearn import hmm
    
    states = ["Rainy", "Sunny"]
    n_states = len(states)
    
    observations = ["walk", "shop", "clean"]
    n_observations = len(observations)
    
    start_probability = np.array([0.6, 0.4])
    
    transition_probability = np.array([
      [0.7, 0.3],
      [0.4, 0.6]
    ])
    
    emission_probability = np.array([
      [0.1, 0.4, 0.5],
      [0.6, 0.3, 0.1]
    ])
    
    model = hmm.MultinomialHMM(n_components=n_states)
    model.startprob=start_probability
    model.transmat=transition_probability
    model.emissionprob=emission_probability
    
    # predict a sequence of hidden states based on visible states
    bob_says = [0, 2, 1, 1, 2, 0]
    model = model.fit(bob_says)
    logprob, alice_hears = model.decode(bob_says, algorithm="viterbi")
    print "Bob says:", ", ".join(map(lambda x: observations[x], bob_says))
    print "Alice hears:", ", ".join(map(lambda x: states[x], alice_hears))
    
    opened by ambushed 21
  • gcc error when installing with pip install

    gcc error when installing with pip install

    I get hmmlearn/_hmmc.c:239:28: fatal error: numpy/npy_math.h: No such file or directory yet the installation seems to finish successfully.

    requirements.txt file:

    click==6.7
    cython==0.25.2
    joblib==0.11
    numpy==1.12.1
    pandas==0.19.2
    python-speech-features==0.5
    scikit-learn==0.18.1
    scipy==0.19.0
    hmmlearn==0.2.0
    
    Running setup.py bdist_wheel for hmmlearn: started
      Running setup.py bdist_wheel for hmmlearn: finished with status 'error'
      Complete output from command /opt/conda/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8l6nu2n1/hmmlearn/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpi_45qjtvpip-wheel- --python-tag cp36:
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.6
      creating build/lib.linux-x86_64-3.6/hmmlearn
      copying hmmlearn/hmm.py -> build/lib.linux-x86_64-3.6/hmmlearn
      copying hmmlearn/utils.py -> build/lib.linux-x86_64-3.6/hmmlearn
      copying hmmlearn/base.py -> build/lib.linux-x86_64-3.6/hmmlearn
      copying hmmlearn/__init__.py -> build/lib.linux-x86_64-3.6/hmmlearn
      creating build/lib.linux-x86_64-3.6/hmmlearn/tests
      copying hmmlearn/tests/test_utils.py -> build/lib.linux-x86_64-3.6/hmmlearn/tests
      copying hmmlearn/tests/test_gaussian_hmm.py -> build/lib.linux-x86_64-3.6/hmmlearn/tests
      copying hmmlearn/tests/test_gmm_hmm.py -> build/lib.linux-x86_64-3.6/hmmlearn/tests
      copying hmmlearn/tests/test_multinomial_hmm.py -> build/lib.linux-x86_64-3.6/hmmlearn/tests
      copying hmmlearn/tests/test_base.py -> build/lib.linux-x86_64-3.6/hmmlearn/tests
      copying hmmlearn/tests/__init__.py -> build/lib.linux-x86_64-3.6/hmmlearn/tests
      running build_ext
      building 'hmmlearn._hmmc' extension
      creating build/temp.linux-x86_64-3.6
      creating build/temp.linux-x86_64-3.6/hmmlearn
      gcc -pthread -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/opt/conda/include/python3.6m -c hmmlearn/_hmmc.c -o build/temp.linux-x86_64-3.6/hmmlearn/_hmmc.o -O3
      hmmlearn/_hmmc.c:239:28: fatal error: numpy/npy_math.h: No such file or directory
       #include "numpy/npy_math.h"
                                  ^
      compilation terminated.
      error: command 'gcc' failed with exit status 1
      
      ----------------------------------------
      Failed building wheel for hmmlearn
      Running setup.py clean for hmmlearn
    Successfully built python-speech-features
    Failed to build hmmlearn
    Installing collected packages: click, cython, joblib, numpy, pytz, python-dateutil, pandas, python-speech-features, scikit-learn, scipy, hmmlearn
      Running setup.py install for hmmlearn: started
        Running setup.py install for hmmlearn: finished with status 'done'
    **Successfully installed** click-6.7 cython-0.25.2 **hmmlearn-0.2.0** joblib-0.11 numpy-1.12.1 pandas-0.19.2 python-dateutil-2.6.0 python-speech-features-0.5 pytz-2017.2 scikit-learn-0.18.1 scipy-0.19.0
    
    needs-info 
    opened by chananshgong 20
  • ImportError: DLL load failed: The specified module could not be found.

    ImportError: DLL load failed: The specified module could not be found.

    my OS is win7 x64 . visual studio 2015, also visual studio 2013, and python 3.5 x64(by anaconda) are set up. hmmlearn is set up successfully. and validated by the code: >>>import hmmlearn >>> hmmlearn.version and the output is '0.2.0' which is last version of hmmlearn. but, if i put the code like the following, >>>from hmmlearn import hmm i get the error as the following,

    C:\Anaconda3_64\python.exe E:/pycharm/plot_hmm_stock_analysis/hmm_stock_analysis.py Traceback (most recent call last): File "E:/pycharm/plot_hmm_stock_analysis/hmm_stock_analysis.py", line 17, in from hmmlearn import hmm File "C:\Anaconda3_64\lib\site-packages\hmmlearn-0.2.0-py3.5-win-amd64.egg\hmmlearn\hmm.py", line 14, in from sklearn import cluster File "C:\Anaconda3_64\lib\site-packages\sklearn__init__.py", line 57, in from .base import clone File "C:\Anaconda3_64\lib\site-packages\sklearn\base.py", line 11, in from .utils.fixes import signature File "C:\Anaconda3_64\lib\site-packages\sklearn\utils__init__.py", line 11, in from .validation import (as_float_array, File "C:\Anaconda3_64\lib\site-packages\sklearn\utils\validation.py", line 16, in from ..utils.fixes import signature File "C:\Anaconda3_64\lib\site-packages\sklearn\utils\fixes.py", line 324, in from scipy.sparse.linalg import lsqr as sparse_lsqr File "C:\Anaconda3_64\lib\site-packages\scipy\sparse\linalg__init__.py", line 109, in from .isolve import * File "C:\Anaconda3_64\lib\site-packages\scipy\sparse\linalg\isolve__init__.py", line 6, in from .iterative import * File "C:\Anaconda3_64\lib\site-packages\scipy\sparse\linalg\isolve\iterative.py", line 7, in from . import _iterative ImportError: DLL load failed: The specified module could not be found.

    why? and how to fix it!?

    by the way, if in cmd, using "pip freeze" commond, it shows hmmlearn and the version of it is 0.2.0. BUT, if using "conda list", no hmmlearn shows!!

    opened by genliu777 18
  • GMMHMM models training not converging (?)

    GMMHMM models training not converging (?)

    Hi all, I am having a problem when trying to fit multiple GMMHMM models to solve a classification problem of emotions recognition from speech samples. Basically, the models often don't converge: even if the monitor reports 'True' if printed, I can see in the history that the likelihood is not strictly increasing. Actually, it decreases at some point and the training procedure stops.

    Here, I report only the procedure for training one of the models (I should have seven, each one trained with a different training set). The data loaded are attached: data_training.npy.zip

    from hmmlearn import hmm
    import numpy as np 
    data = np.load('data_training.npy', allow_pickle=True)
    
    
    hmm = hmm.GMMHMM(n_components=2, n_mix=2,n_iter=1000, covariance_type="diag", verbose=True ) 
    
    X_sequence_concat = np.concatenate(data) 
    lengths = []
    for el in data:
        lengths.append(len(el))
    
    hmm.fit(X_sequence_concat, np.array(lengths))   
    print("Is the HMM training converged? " + str(hmm.monitor_.converged))
    

    In my actual implementation I have to do this for seven different models and sometimes I get this problem and sometimes I don't, as you can see from the results reported below:

    Schermata 2021-04-23 alle 13 14 43

    Can you please help me? I'm really struggling with this and I can't find a possible cause of the problem.

    Thanks in advance!

    bug 
    opened by giorgiolbt 16
  • [ENH, MRG] Add PoissonHMM

    [ENH, MRG] Add PoissonHMM

    Adds a PoissonHMM with an example.

    I think this is somewhat close so if you have time, a review would be great @anntzer @blckmaxima.

    I'm not sure if there is a standard we could compare to like the Wikipedia one for the MultiNomialHMM or if that's necessary.

    opened by alexrockhill 15
  • how to export emission matrix that can be used by external forward algorithm ?

    how to export emission matrix that can be used by external forward algorithm ?

    I want to export the trans matrix, and emission matrix from hmmlearn , and used as model parameters in forward algorithm written by c++, it'clear that "transmat_" attribute is the trans matrix of hiden state ,while how to get the so called emission matrix ? does "means_" attribute of model represent the emission matrix ? thanks !

    opened by fulean 13
  • Divide by zero encountered in true_divide while fitting GMMHMM model

    Divide by zero encountered in true_divide while fitting GMMHMM model

    I am trying to train an gmmhmm model with multi-variate timeseries of 25 features in the following way:

    hmm_g = hmm.GMMHMM(n_components=4, n_mix=2).fit(X, lengths)
    

    where X is an array with shape (134165, 25) and lengths is an array of the lengths of each time series.

    It works correctly if I run the code with n_components=2 but if change the gmmhmm params to n_components=4, n_mix=2 I've got the following error:

    C:\Python38\lib\site-packages\hmmlearn\hmm.py:1052: RuntimeWarning: divide by zero encountered in true_divide self.covars_ = c_n / c_d

    And I dont really understand why is this happening.

    Thank you in advance.

    opened by hojasc 2
  • Problem with parallel processing for scipy > 1.4.1

    Problem with parallel processing for scipy > 1.4.1

    I have an app that requires several thousand runs of hmm.fit and have set it up to run in parallel. I'm encountering an issue where using any scipy > 1.4.1 causes the parallelization to fail to scale. Here is a simple example:

    #!/usr/bin/python3
    
    # Parallel scaling tests of hmmlearn
    
    # Imports
    from multiprocessing import Pool
    import time
    from hmmlearn import hmm
    import numpy as np
    
    # Functions
    def _generatePattern():
    	# Generate a test pattern for the hmm to learn
    	# Generate a test pattern for the hmm to learn
    	cycle = np.zeros(90)
    	cycle[10:20] = 1
    	cycle[30:40] = 1
    	cycle[50:60] = 1
    	cycle[70:80] = 1
    
    	return cycle
    
    def _runhmm(timeSeries):
        if len(timeSeries.shape) == 1:
            timeSeries = timeSeries.reshape(-1, 1)
        
        # Create the 2 state model
        model = hmm.GaussianHMM(n_components=2, 
                                covariance_type="full", 
                                init_params="stmc", 
                                params="stmc", 
                                n_iter=100, 
                                random_state = int(42),
                                verbose=False)
    
        # Fit
        model.fit(timeSeries.astype(float))
    
    def _testfunction(p, z):
    	for i in range(100):
    		timeSeries = _generatePattern()
    		_runhmm(timeSeries)
    
    def _runNProcs(numberOfProcs):
    	fnInputs = []
    	for p in range(numberOfProcs):
    		fnInput = (p, p)
    		fnInputs.append(fnInput) 
    
    	pool1 = Pool(processes=len(fnInputs)) 
    	output1 = pool1.starmap(_testfunction, fnInputs)
    	pool1.close()
    	pool1.join()
    
    # Run once
    startTime = time.time()
    _runNProcs(1)
    endTime = time.time()
    print("Single proc ran in {}s.".format(endTime - startTime))
    
    # Run 8 times for parallel testing
    startTime = time.time()
    _runNProcs(8)
    endTime = time.time()
    print("Multi proc (8 procs) ran in {}s.".format(endTime - startTime))
    

    When run with scipy==1.4.1 or earlier we get good scaling (ran on 12-core processor):

    Single proc ran in 0.907646894454956s.
    Multi proc (8 procs) ran in 1.0238242149353027s.
    

    When run with scipy==1.5 or later the single proc run is slower and we get almost no scaling:

    Single proc ran in 1.6103289127349854s.
    Multi proc (8 procs) ran in 11.647212505340576s.
    

    Any thoughts?

    Thank you much.

    opened by HLorzel 4
  • Variational inference

    Variational inference

    @anntzer Leaving an early draft of incorporating Variational Inference training of HMMs so I may receive feedback before I keep going.

    Some Notes:

    • I derive from BaseHMM, and am able to reuse most of it, with a few exceptions.
    • VariationalGaussianHMM is still incomplete - only Full Covariance is supported.
    • Tests are lacking.

    Up Next:

    • Finish the different covariance types for Gaussian
    • Add Mixture of Gaussian Emissions
    opened by blckmaxima 14
  • Parallelize `fit` and `score_batches` with joblib

    Parallelize `fit` and `score_batches` with joblib

    Since most of the cython code releases the GIL, the joblib threading backend can be used to parallelize some of the operations. Since a Python dictionary is used after the calculations to collect statistics, I used a threading lock to prevent races.

    I am not 100% sure if I missed any other places which would need to be locked however.

    This PR depends on this one https://github.com/hmmlearn/hmmlearn/pull/439

    opened by Dobatymo 3
  • add score_batches method which returns a list of scores

    add score_batches method which returns a list of scores

    Added score_batches method which returns a list of scores (one for each sequence) instead of a cumulative score.

    See https://github.com/hmmlearn/hmmlearn/issues/272

    opened by Dobatymo 0
Releases(0.2.5)
  • 0.2.0(Mar 1, 2016)

    The release contains a known bug: fitting GMMHMM with covariance types other than "diag" does not work. This is going to be fixed in the following version. See issue #78 on GitHub for details.

    • Removed deprecated re-exports from hmmlean.hmm.
    • Speed up forward-backward algorithms and Viterbi decoding by using Cython typed memoryviews. Thanks to @cfarrow. See PR#82 on GitHub.
    • Changed the API to accept multiple sequences via a single feature matrix X and an array of sequence lengths. This allowed to use the HMMs as part of scikit-learn Pipeline. The idea was shamelessly plugged from seqlearn package by @larsmans. See issue #29 on GitHub.
    • Removed params and init_params from internal methods. Accepting these as arguments was redundant and confusing, because both available as instance attributes.
    • Implemented ConvergenceMonitor, a class for convergence diagnostics. The idea is due to @mvictor212.
    • Added support for non-fully connected architectures, e.g. left-right HMMs. Thanks to @matthiasplappert. See issue #33 and PR #38 on GitHub.
    • Fixed normalization of emission probabilities in MultinomialHMM, see issue #19 on GitHub.
    • GaussianHMM is now initialized from all observations, see issue #1 on GitHub.
    • Changed the models to do input validation lazily as suggested by the scikit-learn guidelines.
    • Added min_covar parameter for controlling overfitting of GaussianHMM, see issue #2 on GitHub.
    • Accelerated M-step fro GaussianHMM with full and tied covariances. See PR #97 on GitHub. Thanks to @anntzer.
    • Fixed M-step for GMMHMM, which incorrectly expected GMM.score_samples to return log-probabilities. See PR #4 on GitHub for discussion. Thanks to @mvictor212 and @michcio1234.
    Source code(tar.gz)
    Source code(zip)
  • 0.1.1(Mar 1, 2016)

BErt-like Neurophysiological Data Representation

BENDR BErt-like Neurophysiological Data Representation This repository contains the source code for reproducing, or extending the BERT-like self-super

null 100 Jun 24, 2022
Udacity-api-reporting-pipeline - Udacity api reporting pipeline

udacity-api-reporting-pipeline In this exercise, you'll use portions of each of

Fabio Barbazza 1 Feb 15, 2022
ForecastGA is a Python tool to forecast Google Analytics data using several popular time series models.

ForecastGA is a tool that combines a couple of popular libraries, Atspy and googleanalytics, with a few enhancements.

JR Oakes 32 Apr 13, 2022
A Python package for Bayesian forecasting with object-oriented design and probabilistic models under the hood.

Disclaimer This project is stable and being incubated for long-term support. It may contain new experimental code, for which APIs are subject to chang

Uber Open Source 1.4k Jul 3, 2022
Describing statistical models in Python using symbolic formulas

Patsy is a Python library for describing statistical models (especially linear models, or models that have a linear component) and building design mat

Python for Data 836 Jun 21, 2022
A Python package for the mathematical modeling of infectious diseases via compartmental models

A Python package for the mathematical modeling of infectious diseases via compartmental models. Originally designed for epidemiologists, epispot can be adapted for almost any type of modeling scenario.

epispot 10 May 7, 2022
vartests is a Python library to perform some statistic tests to evaluate Value at Risk (VaR) Models

vartests is a Python library to perform some statistic tests to evaluate Value at Risk (VaR) Models, such as: T-test: verify if mean of distribution i

RAFAEL RODRIGUES 1 Dec 1, 2021
Fit models to your data in Python with Sherpa.

Table of Contents Sherpa License How To Install Sherpa Using Anaconda Using pip Building from source History Release History Sherpa Sherpa is a modeli

null 125 May 3, 2022
A probabilistic programming language in TensorFlow. Deep generative models, variational inference.

Edward is a Python library for probabilistic modeling, inference, and criticism. It is a testbed for fast experimentation and research with probabilis

Blei Lab 4.7k Jun 29, 2022
A probabilistic programming library for Bayesian deep learning, generative models, based on Tensorflow

ZhuSuan is a Python probabilistic programming library for Bayesian deep learning, which conjoins the complimentary advantages of Bayesian methods and

Tsinghua Machine Learning Group 2.1k Jun 26, 2022
Generate lookml for views from dbt models

dbt2looker Use dbt2looker to generate Looker view files automatically from dbt models. Features Column descriptions synced to looker Dimension for eac

lightdash 103 Jun 30, 2022
Collections of pydantic models

pydantic-collections The pydantic-collections package provides BaseCollectionModel class that allows you to manipulate collections of pydantic models

Roman Snegirev 10 Jun 12, 2022
In this tutorial, raster models of soil depth and soil water holding capacity for the United States will be sampled at random geographic coordinates within the state of Colorado.

Raster_Sampling_Demo (Resulting graph of this demo) Background Sampling values of a raster at specific geographic coordinates can be done with a numbe

null 3 Feb 14, 2022
Fitting thermodynamic models with pycalphad

ESPEI ESPEI, or Extensible Self-optimizing Phase Equilibria Infrastructure, is a tool for thermodynamic database development within the CALPHAD method

Phases Research Lab 40 Apr 11, 2022
A model checker for verifying properties in epistemic models

Epistemic Model Checker This is a model checker for verifying properties in epistemic models. The goal of the model checker is to check for Pluralisti

Thomas Träff 2 Dec 22, 2021
Karate Club: An API Oriented Open-source Python Framework for Unsupervised Learning on Graphs (CIKM 2020)

Karate Club is an unsupervised machine learning extension library for NetworkX. Please look at the Documentation, relevant Paper, Promo Video, and Ext

Benedek Rozemberczki 1.7k Jun 30, 2022
Minimal working example of data acquisition with nidaqmx python API

Data Aquisition using NI-DAQmx python API Based on this project It is a minimal working example for data acquisition using the NI-DAQmx python API. It

Pablo 1 Nov 5, 2021
Get mutations in cluster by querying from LAPIS API

Cluster Mutation Script Get mutations appearing within user-defined clusters. Usage Clusters are defined in the clusters dict in main.py: clusters = {

neherlab 1 Oct 22, 2021
Created covid data pipeline using PySpark and MySQL that collected data stream from API and do some processing and store it into MYSQL database.

Created covid data pipeline using PySpark and MySQL that collected data stream from API and do some processing and store it into MYSQL database.

null 2 Nov 20, 2021