--- id: hmmlearn version: "0.3.3" license: unclear license_treatment: permissive maintenance: dormant --- # hmmlearn — Hidden Markov Models in Python with scikit-learn like API License: permissive · Maintenance: dormant · Downloads: 1.3M/mo ## What it is and what it does hmmlearn provides a suite of algorithms for training and using Hidden Markov Models without labeled data. It wraps the mathematical machinery of HMM inference—forward-backward algorithms, Viterbi decoding, and parameter estimation—behind a scikit-learn-style interface, so if you've used scikit-learn's fit/predict pattern, the API will feel familiar. The package depends on numpy, scikit-learn, and scipy for its numerical and statistical foundations. Typical use involves fitting an HMM to sequence data (like time series or biological sequences) to learn the underlying state structure, then using that model to decode hidden states or generate predictions. It's built for research and production work on sequence modeling tasks where you don't have ground-truth labels for the states themselves. Use it for: - Train HMM models on unlabeled time-series data to discover hidden state patterns in sensor readings or financial data. - Decode the most likely sequence of hidden states given observed data using Viterbi algorithm. - Model biological sequences (DNA, protein) where true state labels are unknown but state transitions follow Markovian structure. - Estimate transition and emission probabilities from sequence data for downstream inference tasks. - Prototype sequence modeling experiments before moving to more complex approaches. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. hmmlearn implements unsupervised learning and inference algorithms for Hidden Markov Models with a scikit-learn compatible API. Yes, if you need unsupervised HMM modeling and can accept dormant maintenance. The package is stable, has no known vulnerabilities, and the scikit-learn API integration is well-established. Install friction is moderate (C compiler required) but manageable. Best suited for research, prototyping, or production systems where HMM is the right model and you don't expect active feature development. ## Install pip install hmmlearn uv add hmmlearn poetry add hmmlearn ## Installing hmmlearn Before you install: Medium install friction due to C compiler requirement. Package is in dormant maintenance status with last release 652 days ago, though the repository remains active and the codebase is stable. License in practice: BSD permissive license allows commercial and private use with minimal restrictions. Quickstart: pip install hmmlearn import numpy as np from hmmlearn import hmm model = hmm.GaussianHMM(n_components=3) model.fit(X) hidden_states = model.predict(X) Requires a C compiler and Python development headers to build from source; prebuilt wheels are available for Python 3.10–3.13 on common platforms. Verify before relying: - Whether the 652-day gap since last release reflects active maintenance or abandonment risk - Current state of C compiler compatibility across modern build environments - Whether scipy is a runtime dependency (listed as runtime but not explicitly documented) ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: medium - Maintenance: dormant - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags hidden markov models python, hmm unsupervised learning, markov chain inference, sequence modeling algorithms, hmm scikit-learn, probabilistic sequence models, hmm training inference, sequence-modeling, unsupervised-learning, markov-models [View on SkillFed](https://skillfed.io/packages/hmmlearn) · [View on PyPI](https://pypi.org/project/hmmlearn/)