Theory¶
This page derives the formulas used in fewlabels. See References for the original papers.
The estimator¶
Let \(Y\) be the outcome and \(f \in \mathbb{R}^K\) the predictions of \(K\) annotators. The labelled sample has \(n\) cases with \((Y_i, f_i)\); the unlabelled sample has \(N\) cases with \(\tilde f_j\) only. For a fixed weight vector \(\lambda\),
Both prediction means estimate \(E[f]\), so their difference has expectation zero and \(\hat\theta_\lambda\) is unbiased for \(\theta = E[Y]\) for every \(\lambda\). This is why the interval stays valid when the model is biased or poor.
Variance and optimal weights¶
Write \(V_L\) and \(C_L\) for (co)variances of means on the labelled sample and \(V_U\) on the unlabelled sample. Since the samples are independent,
a quadratic function minimised by
For one annotator and independent cases, \(\lambda^\ast = \operatorname{Cov}(Y, f) / \{(1 + n/N)\operatorname{Var}(f)\}\), the power tuning of PPI++. The interval is \(\hat\theta \pm z_{1-\alpha/2}\sqrt{V(\hat\lambda)}\). Estimating \(\lambda\) on the same data changes the estimator by a term of smaller order than its standard error, so the interval is asymptotically valid.
Planning¶
Substituting \(\lambda^\ast\) for independent cases gives
where \(R^2\) is the population coefficient of determination of the regression of \(Y\) on \(f\). For a binary outcome with prevalence \(p\) and a binary prediction with sensitivity \(s_e\) and specificity \(s_p\), \(q = p\,s_e + (1-p)(1-s_p)\) and
The number of labels for a margin of error \(w\) is the smallest \(n\) with \(z\sqrt{V(\lambda^\ast)} \le w\), found by bisection. Power for an effect \(\delta\) uses the normal approximation \(1 - \Phi(z_{1-\alpha/2} - \delta/\sqrt{V}) + \Phi(-z_{1-\alpha/2} - \delta/\sqrt{V})\).
Clusters¶
With clusters \(g = 1, \dots, G\) the covariance of a mean of \(z\) is estimated by
which equals the usual estimate when every case is its own cluster. The same formulas for \(\lambda^\ast\) and \(V(\lambda)\) then apply.
Known selection probabilities¶
If case \(i\) of a population of \(N\) is labelled with known probability \(\pi_i\), independently of the others, then with labelling indicator \(\xi_i\)
is unbiased because \(E[\xi_i/\pi_i] = 1\). Writing
\(\psi_i = A_i + B_i^\top\lambda\) with \(A_i = \xi_i Y_i/\pi_i\) and
\(B_i = f_i(1 - \xi_i/\pi_i)\), the variance is quadratic in \(\lambda\)
with minimiser \(\lambda^\ast = -\operatorname{Var}(B)^{-1}\operatorname{Cov}(B, A)\).
The variance is smallest when \(\pi_i\) is proportional to the expected
absolute residual, which motivates inclusion_probabilities.
Sensitivity to unknown selection¶
Write the estimate with \(\lambda = 1\) as the mean prediction over all cases plus a weighted mean of labelled residuals \(r_i = Y_i - f_i\) with weights \(w_i = 1/\pi_i\). Under the marginal sensitivity model the true inverse probability lies in
The extreme values of the weighted mean \(\sum w_i r_i / \sum w_i\) over this box are attained at a vertex where the high weights go to the largest (for the maximum) or smallest (for the minimum) residuals, so they are found by scanning the sorted residuals. A percentile bootstrap of the two extremes gives an interval that covers the identified set.
Several annotators¶
The effective number of independent annotators reported by
annotator_report is the classical
\(K_{\text{eff}} = K / \bigl(1 + (K-1)\bar\rho\bigr)\), where \(\bar\rho\) is
the mean pairwise correlation of the annotators' errors.