openclean.embedding.feature.frequency module

Feature function that computes normalized frequencies for values in a list.

class openclean.embedding.feature.frequency.NormalizedFrequency(normalizer=None, mapping=None)

Bases: openclean.function.value.base.ValueFunction

Value function that computes a normalized frequency for values in a given list of values.

eval(value)

Return the normalized frequency for the given value.

Parameters

value (scalar or tuple) – Value from the list that was used to prepare the function.

Return type

float

is_prepared()

The object still requires preparation if either of the internal variables is still None.

Return type

bool

prepare(values)

Compute the frequency for each value to be used as the feature function. Then initialize the normalization function using the list of value frequencies.

Parameters

values (list) – List of value sin the stream.

Return type

openclean.embedding.feature.frequency.NormalizedFrequency