probly.utils.probabilities¶
General utility functions for all other modules.
Functions
|
Compute the differential entropy of a Gaussian distribution given the variance. |
|
Compute the intersection probability of a credal set based on intervals of lower and upper probabilities. |
|
Compute the KL-divergence between two Gaussian distributions. |
- probly.utils.probabilities.differential_entropy_gaussian(sigma2, base=2)[source]¶
Compute the differential entropy of a Gaussian distribution given the variance.
- probly.utils.probabilities.intersection_probability(probs)[source]¶
Compute the intersection probability of a credal set based on intervals of lower and upper probabilities.
Computes the intersection probability from [Cuz22].
- Parameters:
probs (ndarray) – numpy.ndarray, shape (n_instances, n_samples, n_classes), credal sets
- Returns:
numpy.ndarray, shape (n_instances, n_classes), intersection probability of the credal sets
- Return type:
int_probs
- probly.utils.probabilities.kl_divergence_gaussian(mu1, sigma21, mu2, sigma22, base=2)[source]¶
Compute the KL-divergence between two Gaussian distributions.
- Parameters:
mu1 (float | ndarray) – float or numpy.ndarray shape (n_instances,), mean of the first Gaussian distribution
sigma21 (float | ndarray) – float or numpy.ndarray shape (n_instances,), variance of the first Gaussian distribution
mu2 (float | ndarray) – float or numpy.ndarray shape (n_instances,), mean of the second Gaussian distribution
sigma22 (float | ndarray) – float or numpy.ndarray shape (n_instances,), variance of the second Gaussian distribution
base (float) – float, base of the logarithm
- Returns:
float or numpy.ndarray shape (n_instances,), KL-divergence between the two Gaussian distributions
- Return type:
kl_div