SafePredict: A Meta-Algorithm for Machine Learning That Uses Refusals to Guarantee Correctness

Mustafa A. Kocak, David Ramirez, Elza Erkip, Dennis E. Shasha

Research output: Contribution to journalArticlepeer-review


SafePredict is a novel meta-algorithm that works with any base prediction algorithm for online data to guarantee an arbitrarily chosen correctness rate, 1-ϵ, by allowing refusals. Allowing refusals means that the meta-algorithm may refuse to emit a prediction produced by the base algorithm so that the error rate on non-refused predictions does not exceed ϵ. The SafePredict error bound does not rely on any assumptions on the data distribution or the base predictor. When the base predictor happens not to exceed the target error rate ϵ, SafePredict refuses only a finite number of times. When the error rate of the base predictor changes through time SafePredict makes use of a weight-shifting heuristic that adapts to these changes without knowing when the changes occur yet still maintains the correctness guarantee. Empirical results show that (i) SafePredict compares favorably with state-of-the-art confidence-based refusal mechanisms which fail to offer robust error guarantees; and (ii) combining SafePredict with such refusal mechanisms can in many cases further reduce the number of refusals. Our software is included in the supplementary material, which can be found on the Computer Society Digital Library at

Original languageEnglish (US)
Article number8784215
Pages (from-to)663-678
Number of pages16
JournalIEEE Transactions on Pattern Analysis and Machine Intelligence
Issue number2
StatePublished - Feb 1 2021

ASJC Scopus subject areas

  • Software
  • Computer Vision and Pattern Recognition
  • Computational Theory and Mathematics
  • Artificial Intelligence
  • Applied Mathematics


Dive into the research topics of 'SafePredict: A Meta-Algorithm for Machine Learning That Uses Refusals to Guarantee Correctness'. Together they form a unique fingerprint.

Cite this