cutcutcodec.core.signal.predict.Predictor

class cutcutcodec.core.signal.predict.Predictor(memory: Integral | float = inf)[source]

Basic structuring class for predicting a sequence of reels.

Attributes

memoryint

The number of memorized samples (readonly).

obslist[float]

Past observations, more recent first (readonly).

Initialize the memory.

Parameters

memoryint, default=inf

The number of samples to be memorised.

property memory: int | float

Return the number of memorized samples.

property obs: list[float]

Return the past observations.

predict(nbr: Integral = 1) list[float][source]

Predict the next samples \(\hat{o}_{n+1}\).

Parameters

nbrint, default=1

The number of sample to predict.

Returns

sampleslist[float]

The predicted sample, the last predicted in first position.

abstractmethod predict_next() float[source]

Predict the next sample \(\hat{o}_{n+1}\).

update(obs: Real | Iterable[Real])[source]

Update the state of the predictor using the new samples.

Parameters

obsfloat or list[float]

The new observation(s).