MarkovSetN:
Filter:
MathLib/Classes (extension) | Collections > Unordered | Libraries > MathLib > Markov & Fuzzy

MarkovSetN
ExtensionExtension

nth order markov set

Description

Constant order set. For variable order see ShannonFinger. Uses an optimized identity lookup in which arrays of elements are stored internally as symbols.

Part of MathLib, a diverse library of mathematical functions.

Class Methods

.new

Arguments:

args

A list of arrays that each represent one node in the set:

[[array_of_elements], [next_elements], [weigths]]

array_of_elementsShould be of size order
next_elementsThe next node is searched by simple equality. If nil, this is a terminator node
weightsThe array is normalized. If weigths is nil, equal weight is used.

If args is nil, the set is created and may be trained by the other methods.

order

The order of the set.

updateSeeds

If set to true, each element is always added to the seeds

.fill

Arguments:

n

Number of items to read.

stream

A function or stream that returns items to read.

order

Order of the new set.

Examples

direct node definition

training by a stream

Authors

Julian Rohrhuber, 2004, 2007.