exp_utils module#
- class permanova.experiments.exp_utils.NumpyTest[source]#
Bases:
objectclass to perform tabular tests with the NumPy implementation of LightPERMANOVA
- static generate_samples_with_mixture_covariates(dim: int, noise_mean_factor: float, noise_std_factor: float, size: int) tuple[source]#
Generates samples with covariates drawn from mixture of two gaussians
- Parameters:
dim (int) – number of covariates that describe the samples
noise_mean_factor (float) – to each of the gaussians of sample_2 will be applied a noise with mean = noise_mean_factor * original mean of the gaussian
noise_std_factor (float) – to each of the gaussians of sample_2 will be applied a noise with std = noise_std_factor * original std of the gaussian
size (int) – size of the samples
- Returns:
(sample_1: np.ndarray, sample_2: np.ndarray)
- Return type:
tuple
- static generate_samples_with_normal_covariates(dim: int, noise_mean: float, noise_std: float, size: int) tuple[source]#
Generates samples with normally distributed covariates
- Parameters:
dim (int) – number of covariates that describe the samples
noise_mean (float) – mean of the noise applied to each variable of the original sample
noise_std (float) – std of the noise applied to each variable of the original sample
size (int) – size of the samples
- Returns:
(sample_1: np.ndarray, sample_2: np.ndarray)
- Return type:
tuple
- class permanova.experiments.exp_utils.TorchTest[source]#
Bases:
objectclass to perform tabular tests with the PyTorch implementation of LightPERMANOVA
- static generate_samples_with_mixture_covariates(dim: int, noise_mean_factor: float, noise_std_factor: float, size: int)[source]#
Generates samples with covariates drawn from mixture of two gaussians
- Parameters:
dim (int) – number of covariates that describe the samples
noise_mean_factor (float) – to each of the gaussians of sample_2 will be applied a noise with mean = noise_mean_factor * original mean of the gaussian
noise_std_factor (float) – to each of the gaussians of sample_2 will be applied a noise with std = noise_std_factor * original std of the gaussian
size (int) – size of the samples
- Returns:
(sample_1: np.ndarray, sample_2: np.ndarray)
- Return type:
tuple
- static generate_samples_with_normal_covariates(dim: int, noise_mean: float, noise_std: float, size: int)[source]#
Generates samples with normally distributed covariates
- Parameters:
dim (int) – number of covariates that describe the samples
noise_mean (float) – mean of the noise applied to each variable of the original sample
noise_std (float) – std of the noise applied to each variable of the original sample
size (int) – size of the samples
- Returns:
(sample_1: np.ndarray, sample_2: np.ndarray)
- Return type:
tuple