preds (Tensor) – the predictions for regression tasks. It is a tensor of the shape of nxt, where n is
the number of input molecules/reactions, and t is the number of tasks.
uncs (Tensor) – the predicted uncertainties of the shape of nxt
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
Calibrate regression datasets by applying a scaling value to the uncalibrated standard deviation,
fitted by minimizing the negative-log-likelihood of a normal distribution around each prediction. [levi2022]
preds (Tensor) – the predictions for regression tasks. It is a tensor of the shape of nxt, where n is
the number of input molecules/reactions, and t is the number of tasks.
uncs (Tensor) – the predicted uncertainties of the shape of nxt
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
preds (Tensor) – the predictions for regression tasks. It is a tensor of the shape of nxt, where n is
the number of input molecules/reactions, and t is the number of tasks.
uncs (Tensor) – the predicted uncertainties of the shape of nxt
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
Calibrate regression datasets that have ensembles of individual models that make variance predictions.
This method minimizes the negative log likelihood for the predictions versus the targets by applying
a weighted average across the variance predictions of the ensemble. [wang2021]
preds (Tensor) – the predictions for regression tasks. It is a tensor of the shape of nxt, where n is
the number of input molecules/reactions, and t is the number of tasks.
uncs (Tensor) – the predicted uncertainties of the shape of mxnxt
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
Conformalize quantiles to make the interval \([\hat{t}_{\alpha/2}(x),\hat{t}_{1-\alpha/2}(x)]\) to have
approximately \(1-\alpha\) coverage. [angelopoulos2021]
where \(s\) is the nonconformity score as the difference between \(y\) and its nearest quantile.
\(\hat{t}_{\alpha/2}(x)\) and \(\hat{t}_{1-\alpha/2}(x)\) are the predicted quantiles from a quantile
regression model.
Note
The algorithm is specifically designed for quantile regression model. Intuitively, the set \(C(x)\) just
grows or shrinks the distance between the quantiles by \(\hat{q}\) to achieve coverage. However, this
function can also be applied to regression model without quantiles being provided. In this case, both
\(\hat{t}_{\alpha/2}(x)\) and \(\hat{t}_{1-\alpha/2}(x)\) are the same as \(\hat{y}\). Then, the
interval would be the same for every data point (i.e., \(\left[-\hat{q}, \hat{q} \right]\)).
Parameters:
alpha (float) – The error rate, \(\alpha \in [0, 1]\)
preds (Tensor) – the predictions for regression tasks. It is a tensor of the shape of nxt, where n is
the number of input molecules/reactions, and t is the number of tasks.
uncs (Tensor) – the predicted uncertainties of the shape of nxt
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probability of class 1) of the shape of nxt, where n is the number of input
molecules/reactions, and t is the number of tasks.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
Calibrate classification datasets using the Platt scaling algorithm [guo2017], [platt1999].
In [platt1999], Platt suggests using the number of positive and negative training examples to
adjust the value of target probabilities used to fit the parameters.
References
[guo2017]
Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K. Q. “On calibration of modern neural
networks”. ICML, 2017. https://arxiv.org/abs/1706.04599
Platt, J. “Probabilistic Outputs for Support Vector Machines and Comparisons to
Regularized Likelihood Methods.” Adv. Large Margin Classif. 1999, 10 (3), 61–74.
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probability of class 1) of the shape of nxt, where n is the number of input
molecules/reactions, and t is the number of tasks.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
Calibrate binary classification datasets using isotonic regression as discussed in [guo2017].
In effect, the method transforms incoming uncalibrated confidences using a histogram-like
function where the range of each transforming bin and its magnitude is learned.
References
[guo2017]
Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K. Q. “On calibration of modern neural
networks”. ICML, 2017. https://arxiv.org/abs/1706.04599
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probability of class 1) of the shape of nxt, where n is the number of input
molecules/reactions, and t is the number of tasks.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
Creates conformal in-set and conformal out-set such that, for \(1-\alpha\) proportion of datapoints,
the set of labels is bounded by the in- and out-sets [1]_:
where the in-set \(\hat{\mathcal C}_\text{in}\) is contained by the set of true labels \(\mathcal Y\) and
\(\mathcal Y\) is contained within the out-set \(\hat{\mathcal C}_\text{out}\).
Parameters:
alpha (float) – The error rate, \(\alpha \in [0, 1]\)
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probability of class 1) of the shape of nxt, where n is the number of input
molecules/reactions, and t is the number of tasks.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in the fitting
uncs (Tensor) – a tensor containinig uncalibrated uncertainties
Returns:
the calibrated uncertainties of the shape of nxtx2, where n is the number of input
molecules/reactions, t is the number of tasks, and the first element in the last dimension
corresponds to the in-set \(\hat{\mathcal C}_\text{in}\), while the second corresponds to
the out-set \(\hat{\mathcal C}_\text{out}\).
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probabilities for each class) of the
shape of nxtxc, where n is the number of input molecules/reactions, t is
the number of tasks, and c is the number of classes.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in
the fitting
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probabilities for each class) of the
shape of nxtxc, where n is the number of input molecules/reactions, t is
the number of tasks, and c is the number of classes.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in
the fitting
Calibrate multiclass classification datasets using isotonic regression as discussed in
[guo2017]. It uses a one-vs-all aggregation scheme to extend isotonic regression from binary to
multiclass classifiers.
References
[guo2017]
Guo, C.; Pleiss, G.; Sun, Y.; Weinberger, K. Q. “On calibration of modern neural
networks”. ICML, 2017. https://arxiv.org/abs/1706.04599
uncs (Tensor) – the predicted uncertainties (i.e., the predicted probabilities for each class) of the
shape of nxtxc, where n is the number of input molecules/reactions, t is
the number of tasks, and c is the number of classes.
targets (Tensor) – a tensor of the shape nxt
mask (Tensor) – a tensor of the shape nxt indicating whether the given values should be used in
the fitting