Skip to content

Noise methods

Isabel edited this page May 12, 2023 · 5 revisions

Discrete

Binomial noise

Binomial noise is named after the distribution of the features it is suitable for. Features that follow the binomial distribution are typically binary or count data.

Binomial_noise(clean_data, level, feature_name=None, random_state=None):

Parameters:
clean_data: ndarray or dataframe of shape (n_samples, n_features)
Array of the feature values that will be permuted. If dataframe, feature_name is required to determine which feature the noise should be applied to. .
level: float
The probability of each value to be permuted. If 0, feature is returned without changes. If 1, every value is flipped.
feature_name: str, deafult=None
If clean_data is a dataframe feature name is required to determine which feature will be permuted.
random_state: int, RandomState instance or None, deafult=None
Controls randomness in drawing from the distribution.
Returns:      
result: ndarray or dataframe of shape (n_samples, n_features)
Array or dataframe (depends on input format) with the noisy feature permuted.

Poisson noise

Poisson_noise(clean_data, feature_name=None, random_state=None):

Parameters:
clean_data: ndarray or dataframe of shape (n_samples, n_features)
Array of the feature values that will be permuted. If dataframe, feature_name is required to determine which feature the noise should be applied to. .
feature_name: str, deafult=None
If clean_data is a dataframe feature name is required to determine which feature will be permuted.
random_state: int, RandomState instance or None, deafult=None
Controls randomness in drawing from the distribution.
Returns:      
result: ndarray or dataframe of shape (n_samples, n_features)
Array or dataframe (depends on input format) with the noisy feature permuted.

Continuous

Gaussian

Gaussian_Noise(clean_data, percentage, feature_name=None, random_state=None):

Parameters:
clean_data: ndarray or dataframe of shape (n_samples, n_features)
Array of the feature values that will be permuted. If dataframe, feature_name is required to determine which feature the noise should be applied to. .
percentage: float
ex.
feature_name: str, deafult=None
If clean_data is a dataframe feature name is required to determine which feature will be permuted.
random_state: int, RandomState instance or None, deafult=None
Controls randomness in drawing from the distribution.
Returns:      
result: ndarray or dataframe of shape (n_samples, n_features)
Array or dataframe (depends on input format) with the noisy feature permuted.

Clone this wiki locally