-
Notifications
You must be signed in to change notification settings - Fork 8
How it works
Below, is the example Markov Model which can generate strings with the alphabet "a,b,c"
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"
This time, same procedure will be applied for "bacb" string, with occurrence value of 12.
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.