Skip to content

Commit c52cf08

Browse files
committed
docs: refreshed package info, headers, text
1 parent c6dc8ae commit c52cf08

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

README.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,42 +7,47 @@
77
[![Downloads](https://static.pepy.tech/badge/mchmm)](https://pepy.tech/project/mchmm)
88
[![PyPi](https://img.shields.io/pypi/v/mchmm.svg)](https://pypi.python.org/pypi/mchmm)
99

10-
*mchmm* is a Python package implementing Markov chains and Hidden Markov models in pure NumPy and SciPy.
11-
It can also visualize Markov chains (see below).
10+
A Python package for statistical modeling with Markov chains and Hidden Markov models. Built on NumPy and SciPy, `mchmm` provides efficient implementations of core algorithms including Viterbi decoding and Baum-Welch parameter estimation. The package also includes visualization capabilities for understanding model structure and behavior.
11+
12+
## Key Features
13+
14+
- **Discrete Markov Chains**: Build transition models from sequence data with automatic state inference
15+
- **Hidden Markov Models**: Implement HMMs with customizable observation and state spaces
16+
- **Viterbi Algorithm**: Find most likely state sequences for new observations
17+
- **Baum-Welch Algorithm**: Learn HMM parameters from unlabeled sequence data
18+
- **Statistical Testing**: Built-in chi-squared tests for model validation
19+
- **Visualization**: Generate directed graphs of Markov models using Graphviz
20+
- **Simulation**: Generate synthetic sequences from trained models
1221

1322
## Donate
1423

1524
If you find this package useful, please consider donating any amount of money. This will help me spend more time on supporting open-source software.
1625

1726
<a href="https://www.buymeacoffee.com/maximtrp" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>
1827

19-
Dependencies
20-
------------
21-
22-
* [NumPy](https://www.numpy.org)
23-
* [SciPy](https://www.scipy.org)
24-
25-
26-
Installation
27-
------------
28-
29-
1. Install from PyPi:
28+
## Installation
3029

30+
Install from PyPI:
3131
```bash
3232
pip install mchmm
3333
```
3434

35-
2. Clone a GitHub repository:
36-
35+
Or install from source:
3736
```bash
3837
git clone https://github.com/maximtrp/mchmm.git
3938
cd mchmm
4039
pip install . --user
4140
```
4241

43-
## Features
42+
## Dependencies
43+
44+
- [NumPy](https://www.numpy.org) - Numerical computing
45+
- [SciPy](https://www.scipy.org) - Scientific computing and statistics
46+
- [Graphviz](https://graphviz.org/) - Graph visualization (optional)
47+
48+
## Quick Start
4449

45-
### Discrete Markov chains
50+
### Discrete Markov Chains
4651

4752
Initializing a Markov chain using some data.
4853

@@ -136,9 +141,9 @@ states
136141
# 'ACBACBACBA'
137142
```
138143

139-
## Hidden Markov models
144+
### Hidden Markov Models
140145

141-
We will use a fragment of DNA sequence with TATA box as an example. Initializing a hidden Markov model with sequences of observations and states:
146+
Build HMMs from paired observation and state sequences. This example uses a DNA fragment with TATA box annotation:
142147

143148
```python
144149
import mchmm as mc
@@ -196,9 +201,9 @@ graph = a.graph_make(
196201
graph.render()
197202
```
198203

199-
### Viterbi algorithm
204+
#### Viterbi Algorithm
200205

201-
Running Viterbi algorithm on new observations.
206+
Decode the most likely state sequence for new observations:
202207

203208
```python
204209
new_obs = "GGCATTGGGCTATAAGAGGAGCTTG"
@@ -211,9 +216,9 @@ print("NO", new_obs)
211216
# NO GGCATTGGGCTATAAGAGGAGCTTG
212217
```
213218

214-
### Baum-Welch algorithm
219+
#### Baum-Welch Algorithm
215220

216-
Using Baum-Welch algorithm to infer the parameters of a Hidden Markov model:
221+
Learn HMM parameters from unlabeled sequence data using expectation-maximization:
217222

218223
```python
219224
obs_seq = 'AGACTGCATATATAAGGGGCAGGCTG'

0 commit comments

Comments
 (0)