Reader small image

You're reading from  Practical Guide to Applied Conformal Prediction in Python

Product typeBook
Published inDec 2023
PublisherPackt
ISBN-139781805122760
Edition1st Edition
Right arrow
Author (1)
Valery Manokhin
Valery Manokhin
author image
Valery Manokhin

Valeriy Manokhin is the leading expert in the field of machine learning and Conformal Prediction. He holds a Ph.D.in Machine Learning from Royal Holloway, University of London. His doctoral work was supervised by the creator of Conformal Prediction, Vladimir Vovk, and focused on developing new methods for quantifying uncertainty in machine learning models. Valeriy has published extensively in leading machine learning journals, and his Ph.D. dissertation 'Machine Learning for Probabilistic Prediction' is read by thousands of people across the world. He is also the creator of "Awesome Conformal Prediction," the most popular resource and GitHub repository for all things Conformal Prediction.
Read more about Valery Manokhin

Right arrow

Building computer vision classifiers using conformal prediction

Let’s illustrate the application of conformal prediction to computer vision in practice. We will use a notebook from the book repository available at https://github.com/PacktPublishing/Practical-Guide-to-Applied-Conformal-Prediction/blob/main/Chapter_09.ipynb. This notebook extensively uses notebooks from Anastasios Angelopolous’ Conformal Prediction repo at https://github.com/aangelopoulos/conformal-prediction.

After loading the data, set up the problem and define the desired coverage and the number of points in the calibration set:

n_cal = 1000
alpha = 0.1

The softmax scores were split into the calibration and test datasets, obtaining calibration and test labels:

idx = np.array([1] * n_cal + [0] * (smx.shape[0]-n_cal)) > 0
np.random.seed(42)
np.random.shuffle(idx)
cal_smx, test_smx = smx[idx,:], smx[~idx,:]
cal_labels, test_labels = labels[idx], labels[~idx]

The test dataset contains 49...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Practical Guide to Applied Conformal Prediction in Python
Published in: Dec 2023Publisher: PacktISBN-13: 9781805122760

Author (1)

author image
Valery Manokhin

Valeriy Manokhin is the leading expert in the field of machine learning and Conformal Prediction. He holds a Ph.D.in Machine Learning from Royal Holloway, University of London. His doctoral work was supervised by the creator of Conformal Prediction, Vladimir Vovk, and focused on developing new methods for quantifying uncertainty in machine learning models. Valeriy has published extensively in leading machine learning journals, and his Ph.D. dissertation 'Machine Learning for Probabilistic Prediction' is read by thousands of people across the world. He is also the creator of "Awesome Conformal Prediction," the most popular resource and GitHub repository for all things Conformal Prediction.
Read more about Valery Manokhin