alis.stream_mining.alonMatiasSzegedy#

alis.stream_mining.alonMatiasSzegedy(iterator, k_moment=2, num_variables=3, var_prob=0.1)[source]#

Compute the Kth order moment of a stream using Alon-Matias-Szegedy algorithm

Parameters
iteratoriterator

Iterator of data of any type

k_momentint

Kth order of moment to calculate for

num_variablesinteger

Number of variables to keep for the AMS algorithm

var_probfloat

Probability for next data value to be treated as a variable

Returns
momentint

Kth order moment of a stream