scikit-adaptation / skada

Domain adaptation toolbox compatible with scikit-learn and pytorch
https://scikit-adaptation.github.io/
BSD 3-Clause "New" or "Revised" License
54 stars 16 forks source link

[MRG] CircularValidation: Re-encode y labels before training the estimator on y_source_pred #155

Closed YanisLalou closed 3 months ago

YanisLalou commented 3 months ago

With the CircularValidation scorer we fit an estimator on the prediction of X_source i.e y_pred_source. However some estimator only supports labels in [0, num_classes-1], which is not guaranteed. Indeed for some iterations, ValueError were raised: ValueError: Invalid classes inferred from unique values of 'y'. Expected: [0 1 2 3 4 5 6], got [1 2 3 4 7 8 9] Solution: Re-encode the labels before feeding them to the estimator.

codecov[bot] commented 3 months ago

Codecov Report

Merging #155 (669b539) into main (23b1007) will increase coverage by 0.00%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #155 +/- ## ======================================= Coverage 97.51% 97.51% ======================================= Files 47 47 Lines 4185 4191 +6 ======================================= + Hits 4081 4087 +6 Misses 104 104 ```