Skip to main content

Package for sequence modeling with Andrei Markov's models

Project description

Description

Mapykob is a Python application that provides an easy way to experiment with Markov models. While built for educational purposes, it can both be used for educational or commercial purposes.PyPI hosting

State

travis coverage format version license pyversions implementation status

Installation

To install mapykoB simply run the following command in a terminal window:

$  pip install mapykoB

If you would rather install from source, run the following commands in a terminal window:

$  git clone https://github.com/octoandzl/mapykoB.git
$  cd mapykob
$  python setup.py install

Usage

An example would be:

$  sample_data = np.array([
$    [1, 1, 1, 0, 0, 0, 0, 0],
$    [0, 1, 0, 0, 0, 1, 0, 0],
$    [0, 0, 0, 0, 0, 1, 0, 1],
$    [0, 0, 1, 0, 1, 1, 1, 1],
$    [0, 0, 0, 0, 1, 0, 1, 0],
$    [0, 1, 0, 0, 1, 1, 0, 1],
$    [0, 0, 0, 1, 1, 1, 0, 0]])

$  possible_observations = Counter(sample_data[i][j] for i in range(len(sample_data)) for j in range(len(sample_data[i])))
$  M = 2
$  V = len(possible_observations)
$  hmm_discreet = hmm_discreet(M,sample_data,V)
$  hmm_discreet.pi = np.array([0.5, 0.5])
$  hmm_discreet.A = np.array([[0.7, 0.3], [0.4, 0.6]])
$  hmm_discreet.B = np.array([[0.6, 0.4], [0.3, 0.7]])
$  hmm_discreet.compute_alpha(0)
$  p = hmm_discreet.compute_p_from_alpha(0)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapykoB-0.0.3.tar.gz (7.0 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page