scikit-learn-contrib / MAPIE

A scikit-learn-compatible module to estimate prediction intervals and control risks based on conformal predictions.
https://mapie.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
1.2k stars 99 forks source link

238 giving a fraction of samples instead of a number of samples in the subsample class #464

Closed BaptisteCalot closed 2 weeks ago

BaptisteCalot commented 3 weeks ago

Description

Fix addressing issue 238. We introduce the ability to create a training set using the split method of the subsample class with a fraction between 0 and 1 representing the proportion of the training set. The option to specify an integer representing the number of elements in the training set is still retained

Type of change

In the case where the attribute self.n_samples is a float, the feature n_samples used in the split method of Subsample class becomes self.n_samples * X.shape[0], taking its floor integer part

How Has This Been Tested?

We check that the training and test sets build using the split method are as expected with the given seed. We use two instances of Subsample, one with an integer n_samples and the other with an n_samples less than 1

Checklist