elastic_noiser#
Defines the ElasticNoiser.
- class ElasticNoiser(k: Distribution[float], invert: bool = False, exponential: bool = False)#
Bases:
NoiserThe ElasticNoiser applies noise elastically.
Noise is added randomly at every point using a normal distributions where the variance increases with t.
- k#
maximal variance of the normal distributions
- invert#
If True, noise is added at the beggining of the curve.
- exponential#
If True, uses exponentially increasing noise. If invert = True, exponentially decreasing.
Inits ElasticNoiser with the provided params.
- Parameters:
k – maximal variance of the normal distributions
invert – If True, noise is added at the beggining of the curve.
exponential – If True, uses exponentially increasing noise. If invert = True, exponentially decreasing.
- noisify(signal: DataFrame) DataFrame#
Applies noise to the provided signal.
Applies random gaussian noise with increasing or decreasing variance over time to the signal.
- Parameters:
signal – The input data.
- Returns:
pd.DataFrame
Example
>>> import pandas as pd >>> from simba_ml.simulation import distributions >>> from simba_ml.simulation.noisers.elastic_noiser import ElasticNoiser >>> series = [[0]] * 1000 >>> df = pd.DataFrame(series) >>> df.head() 0 0 0 1 0 2 0 3 0 4 0 >>> noisers = ElasticNoiser(distributions.Constant(10)) >>> noisers.noisify(df).plot()