Interface IUncertaintyEstimator<T>
- Namespace
- AiDotNet.UncertaintyQuantification.Interfaces
- Assembly
- AiDotNet.dll
Defines the contract for models that can estimate prediction uncertainty.
public interface IUncertaintyEstimator<T>
Type Parameters
TThe numeric type used for calculations (e.g., float, double).
Remarks
For Beginners: Uncertainty estimation helps you understand how confident a model is in its predictions.
Think of it like a weather forecast that not only predicts rain but also tells you how sure it is:
- "90% chance of rain" shows high confidence
- "50% chance of rain" shows high uncertainty
This interface is for models that can provide both a prediction and an estimate of how uncertain that prediction is. This is crucial for safety-critical applications like medical diagnosis or autonomous vehicles.
Methods
EstimateAleatoricUncertainty(Tensor<T>)
Estimates aleatoric uncertainty (data noise) for the given input.
Tensor<T> EstimateAleatoricUncertainty(Tensor<T> input)
Parameters
inputTensor<T>The input tensor.
Returns
- Tensor<T>
The aleatoric uncertainty estimate.
Remarks
For Beginners: Aleatoric uncertainty comes from inherent randomness in the data. For example, two identical medical scans might have slightly different measurements due to sensor noise. This type of uncertainty cannot be reduced by collecting more data.
EstimateEpistemicUncertainty(Tensor<T>)
Estimates epistemic uncertainty (model uncertainty) for the given input.
Tensor<T> EstimateEpistemicUncertainty(Tensor<T> input)
Parameters
inputTensor<T>The input tensor.
Returns
- Tensor<T>
The epistemic uncertainty estimate.
Remarks
For Beginners: Epistemic uncertainty comes from the model not having enough knowledge. For example, if your model was trained on cats and dogs, it will have high epistemic uncertainty when shown a horse. This type of uncertainty can be reduced by collecting more training data.
PredictWithUncertainty(Tensor<T>)
Predicts output with uncertainty estimates for a single input.
UncertaintyPredictionResult<T, Tensor<T>> PredictWithUncertainty(Tensor<T> input)
Parameters
inputTensor<T>The input tensor.
Returns
- UncertaintyPredictionResult<T, Tensor<T>>
A prediction result augmented with uncertainty information.
Remarks
For Beginners: This method returns two values:
- mean: The model's best guess for the prediction
- uncertainty: How confident the model is (lower = more confident)