ezmsg.learn.util#

Functions

get_regressor(regressor_type, regressor_name)[source]#
Parameters:
with_fingerprint(axis)[source]#

Compute axis’s fingerprint now, and return the axis.

Every stateful consumer reads the fingerprint of the coordinate axes that describe a stream’s configuration, and the value is cached on the instance and pickled with it. Computing it where the axis is built pays the checksum once, for everybody:

  • In this process the axis object is reused for the life of the stream, so one call covers every message and every consumer downstream of it.

  • Across a process boundary it is better than that. Unpickling hands out a new axis object per message, so a cold axis is re-checksummed by the first consumer in every receiving process, on every message.

Apply it to axes that describe the stream – channel labels, class labels, lag labels – not to per-message coordinates along the stream dimension, whose fingerprint no consumer reads.

Return type:

CoordinateAxis

Parameters:

axis (CoordinateAxis)

Classes

class AdaptiveLinearRegressor(*values)[source]#

Bases: str, Enum

LINEAR = 'linear'#
LOGISTIC = 'logistic'#
SGD = 'sgd'#
PAR = 'par'#
class ClassifierMessage(data, dims, axes=<factory>, attrs=<factory>, key='', stream_dim=None, labels=<factory>)[source]#

Bases: AxisArray

Parameters:
labels: list[str]#
__init__(data, dims, axes=<factory>, attrs=<factory>, key='', stream_dim=None, labels=<factory>)#
Parameters:
Return type:

None

class RegressorType(*values)[source]#

Bases: str, Enum

ADAPTIVE = 'adaptive'#
STATIC = 'static'#
class StaticLinearRegressor(*values)[source]#

Bases: str, Enum

LINEAR = 'linear'#
RIDGE = 'ridge'#