All Projects → BartolomeuD → markov-chain

BartolomeuD / markov-chain

Licence: other
No description or website provided.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to markov-chain

DISCOTRESS
🦜 DISCOTRESS 🦜 is a software package to simulate and analyse the dynamics on arbitrary Markov chains
Stars: ✭ 20 (-41.18%)
Mutual labels:  markov-chains
Probability
Applied Probability Theory for Everyone
Stars: ✭ 93 (+173.53%)
Mutual labels:  markov-chains
cellrank
CellRank for directed single-cell fate mapping
Stars: ✭ 222 (+552.94%)
Mutual labels:  markov-chains
mdpy
Markov Decision Processes in Python
Stars: ✭ 14 (-58.82%)
Mutual labels:  markov-chains
word-prediction
Auto generate text using Markov models.
Stars: ✭ 18 (-47.06%)
Mutual labels:  markov-chains
marc
Markov chain generator for Python and/or Swift
Stars: ✭ 61 (+79.41%)
Mutual labels:  markov-chains
4ti2
A software package for algebraic, geometric and combinatorial problems on linear spaces. By R. Hemmecke, R. Hemmecke, M. Köppe, P. Malkin, M. Walter
Stars: ✭ 21 (-38.24%)
Mutual labels:  markov-chains

What we do here:

  1. take a user activity log
  2. execute the script that trains a Markov Chain and outputs it as a .gefx file
  3. open the file

More details:

Markov Chain definition

We have a set of states, S = {s[1], s[2], ..., s[N]} (these states may represent some events in user logs). The process starts in one of these states and moves successively from one state to another. Each move is called a step. If the chain is currently in state s[i] , then it moves to state s[j] at the next step with a probability denoted by p[i][j], and this probability does not depend upon which states the chain was in before the current. Markov chain is defined by its “Transition matrix” P (containing p[i][j]) of size NxN, where N – is the quantity of nodes in the chain. In our particular case we built a chain to visualize user activity in some MOOC. Each node - is a certain kind of event that happened to users. Each line in the data file - is a specific event that happened to a specific user in a specific time

Data format

The data of user activity should include identification of a user, name of a "step" committed by a user and the time of that step – so that for each user it would be possible to represent his activity as sequence of state-nodes, following one another. The nodes of the chain, in the essence, represent events happening to our user. The data format should be as in the file worklist.csv in the repo. First column - user id, second - event name, third - time in excel-like format represented as a number - but the table should have no header

How to launch

Run the script MarkovChain.py in any Python 3 IDE having your user activity log in a format described earlier in your working directory. By default the data file should be named worklist.csv. The script will create a Graph.gexf - a graph file representing the trained Markov Chain.

Visualize

Use Gephi or any other graph visualization tool that supports the .gefx format to open the resulting file. After some customization within Gephi project you may obtain something like General.gephi file in the repo (also saved as .pdf picture in the repo for the sake of clarity).

For more details read comments in the code in MarkovChain.py

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].