probly.quantification.regression¶
Collection of uncertainty quantification measures for regression settings.
Functions
Compute conditional differential entropy as the aleatoric uncertainty using entropy-based measures. |
|
Compute expected conditional variance as the aleatoric uncertainty using variance-based measures. |
|
|
Compute mutual information as the epistemic uncertainty using entropy-based measures. |
|
Compute total differential entropy as epistemic uncertainty based on [DHernandezLobatoDoshiVelezU18]. |
|
Compute total variance as total uncertainty based on [DHernandezLobatoDoshiVelezU18]. |
Compute variance of conditional expectation as the epistemic uncertainty using variance-based measures. |
- probly.quantification.regression.conditional_differential_entropy(probs)[source]¶
Compute conditional differential entropy as the aleatoric uncertainty using entropy-based measures.
Assume that the input is from a distribution over parameters of a normal distribution. The first element of the parameter vector is the mean and the second element is the variance. The aleatoric uncertainty is the mean of the differential entropy of the samples.
- Parameters:
probs (ndarray) – numpy.ndarray, shape (n_instances, n_samples, (mu, sigma^2))
- Returns:
numpy.ndarray, shape (n_instances,)
- Return type:
cde
- probly.quantification.regression.expected_conditional_variance(probs)[source]¶
Compute expected conditional variance as the aleatoric uncertainty using variance-based measures.
Assume that the input is from a distribution over parameters of a normal distribution. The first element of the parameter vector is the mean and the second element is the variance. The aleatoric uncertainty is the mean of the variance of the samples.
- Parameters:
probs (ndarray) – numpy.ndarray, shape (n_instances, n_samples, (mu, sigma^2))
- Returns:
numpy.ndarray, shape (n_instances,)
- Return type:
ecv
- probly.quantification.regression.mutual_information(probs)[source]¶
Compute mutual information as the epistemic uncertainty using entropy-based measures.
Assume that the input is from a distribution over parameters of a normal distribution. The first element of the parameter vector is the mean and the second element is the variance. The epistemic uncertainty is the expected KL-divergence of the samples to the mean distribution.
- Parameters:
probs (ndarray) – numpy.ndarray, shape (n_instances, n_samples, (mu, sigma^2))
- Returns:
numpy.ndarray, shape (n_instances,)
- Return type:
mi
- probly.quantification.regression.total_differential_entropy(probs)[source]¶
Compute total differential entropy as epistemic uncertainty based on [DHernandezLobatoDoshiVelezU18].
Assume that the input is from a distribution over parameters of a normal distribution. The first element of the parameter vector is the mean and the second element is the variance. The total uncertainty is the differential entropy of the mixture of normal distributions.
- Parameters:
probs (ndarray) – numpy.ndarray, shape (n_instances, n_samples, (mu, sigma^2))
- Returns:
numpy.ndarray, shape (n_instances,)
- Return type:
tde
- probly.quantification.regression.total_variance(probs)[source]¶
Compute total variance as total uncertainty based on [DHernandezLobatoDoshiVelezU18].
Assumes that the input is from a distribution over parameters of a normal distribution. The first element of the parameter vector is the mean and the second element is the variance. The total uncertainty is the variance of the mixture of normal distributions.
- Parameters:
probs (npt.NDArray[np.floating]) – numpy.ndarray, shape (n_instances, n_samples, (mu, sigma^2))
- Returns:
numpy.ndarray, shape (n_instances,)
- Return type:
tv
- probly.quantification.regression.variance_conditional_expectation(probs)[source]¶
Compute variance of conditional expectation as the epistemic uncertainty using variance-based measures.
Assume that the input is from a distribution over parameters of a normal distribution. The first element of the parameter vector is the mean and the second element is the variance. The epistemic uncertainty is the variance of the mean of the samples.
- Parameters:
probs (ndarray) – numpy.ndarray, shape (n_instances, n_samples, (mu, sigma^2))
- Returns:
numpy.ndarray, shape (n_instances,)
- Return type:
vce