hookeai.miscellaneous.noisy_data.inject_disp_noise_csv.NoiseGenerator

class NoiseGenerator[source]

Bases: object

Noise generator.

_noise_distribution

Noise distribution type.

Type:

str, {‘uniform’, ‘gaussian’, ‘spiked_gaussian’}

_noise_parameters

Noise distribution parameters.

Type:

dict

set_noise_distribution(self, noise_distribution)[source]

Set noise distribution type.

set_noise_parameters(self, noise_parameters)[source]

Set noise distribution parameters.

get_required_parameters(cls, noise_distribution)[source]

Get required parameters for given noise distribution type.

generate_noise_path(self, noiseless_path, noise_variability='homoscedastic', heteroscedastic_weights=None)[source]

Generate noise path.

Constructor.

List of Public Methods

generate_noise_path

Generate noise path.

get_required_parameters

Get required parameters for given noise distribution type.

set_noise_distribution

Set noise distribution type.

set_noise_parameters

Set noise distribution parameters.

Methods

__init__()[source]

Constructor.

generate_noise_path(noiseless_path, noise_variability='homoscedastic', heteroscedastic_weights=None)[source]

Generate noise path.

Noise is applied independently for each signal feature.

Parameters:
  • noiseless_path (numpy.ndarray(2d)) – Noiseless signal path history stored as numpy.ndarray(2d) of shape (sequence_length, n_features).

  • noise_variability (str, {'homoscedastic', 'heteroscedastic'}, default='homoscedastic') – Variability of noise across the data. In ‘homoscedastic’ noise, the variance of the noise remains constant across the data points (uniform effect regardless of independent variable). In ‘heteroscedastic’ noise, the variance of the noise depends on the data point.

  • heteroscedastic_weights (numpy.ndarray(1d), default=None) – Weights that materialize noise heteroscedasticity by scaling the noise distribution variance for each data point. Stored as numpy.ndarray(1d) of shape (sequence_length). If None, then defaults to ones (homoscedastic noise).

Returns:

noise_path – Noise path history stored as numpy.ndarray(2d) of shape (sequence_length, n_features).

Return type:

numpy.ndarray(2d)

classmethod get_required_parameters(noise_distribution)[source]

Get required parameters for given noise distribution type.

Parameters:

noise_distribution (str, {'uniform', 'gaussian'}) – Noise distribution type.

Returns:

required_noise_parameters – Noise distribution required parameters.

Return type:

tuple[str]

set_noise_distribution(noise_distribution)[source]

Set noise distribution type.

Parameters:

noise_distribution (str, {'uniform', 'gaussian', 'spiked_gaussian'}) – Noise distribution type.

set_noise_parameters(noise_parameters)[source]

Set noise distribution parameters.

Parameters:

noise_parameters (dict) – Noise distribution parameters.