regressioninc.testing.real module#
Functions for generating and visualising real-valued testing data
- regressioninc.testing.real.generate_linear(coef: ndarray, n_samples: int, intercept: float = 0)[source]#
Generate real-valued linear testing data
- regressioninc.testing.real.add_gaussian_noise(data: ndarray, loc: float = 0, scale: float = 3) ndarray [source]#
Add gaussian noise to an array
- Parameters:
data (np.ndarray) – The data to add the noise to
loc (float, optional) – The location (mean) of the gaussian, by default 0. Usually this should# be left as 0.
scale (float, optional) – The scale (or standard deviation) of the noise, by default 3
- Returns:
Data with noise added
- Return type:
np.ndarray
- regressioninc.testing.real.add_outliers(y: ndarray, outlier_percent: float = 5, outlier_mult=3) ndarray [source]#
Add outliers to a 1-D observations array