apply_mask(X, mask_size=(4, 4), n_masks=1, coord=None, channels=[0, 1, 2], mask_type='uniform', noise_distr=(0, 1), noise_rng=(0, 1), clip_rng=(0, 1))¶
Mask images. Can zero out image patches or add normal or uniformly distributed noise.
X (numpy.ndarray) – Batch of instances to be masked.
tuple) – Tuple with the size of the mask.
int) – Number of masks applied for each instance in the batch X.
list) – Channels of the image to apply the mask to.
str) – Type of mask. One of ‘uniform’, ‘random’ (both additive noise) or ‘zero’ (zero values for mask).
tuple) – Mean and standard deviation for noise of ‘random’ mask type.
tuple) – Min and max value for noise of ‘uniform’ type.
tuple) – Min and max values for the masked instances.
- Return type
Tuple with masked instances and the masks.
inject_outlier_ts(X, perc_outlier, perc_window=10, n_std=2.0, min_std=1.0)¶
Inject outliers in both univariate and multivariate time series data.
X (numpy.ndarray) – Time series data to perturb (inject outliers).
int) – Percentage of observations which are perturbed to outliers. For multivariate data, the percentage is evenly split across the individual time series.
int) – Percentage of the observations used to compute the standard deviation used in the perturbation.
float) – Number of standard deviations in the window used to perturb the original data.
float) – Minimum number of standard deviations away from the current observation. This is included because of the stochastic nature of the perturbation which could lead to minimal perturbations without a floor.
- Return type
Bunch object with the perturbed time series and the outlier labels.