Skip to content

How it works

Ata Hakçıl edited this page May 13, 2021 · 1 revision

What is a markov model

Below, is the example Markov Model which can generate strings with the alphabet "a,b,c"

Iteration 1

Below is a demonstration of how training will be done. For this example, we are going to adjust the model with string "ab", and our occurrence will be "3" From MarkovPasswords, inside the train function, Model::adjust is called with "ab" and "3" parameters.

Now, Model::adjust will iteratively adjust the edge weights accordingly. It starts by adjusting weight between start and "a" node. This is done by calling Edge::adjust of the edge between the nodes.

After adjustment, ajust function iterates to the next character, "b", and does the same thing.

As this string is finished, it will adjust the final weight, b->"end"

Iteration 2

This time, same procedure will be applied for "bacb" string, with occurrence value of 12.

Iteration 38271

As the model is trained, hidden linguistical patterns start to appear, and our model looks like this

With our dataset, without doing any kind of linugistic analysis ourselves, our Markov Model has highlighted that strings are more likely to start with a, b tends to follow a, and a is likely to be repeated in the string.

Clone this wiki locally