scikit-adaptation / skada

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

`Shared` selector should reject test time domain not seen during fitting #84

Open kachayev opened 5 months ago

kachayev commented 5 months ago

This functionality was planned... but was not implemented from what I can tell.

It seems like a good safety guard. It is also important for those algorithms that rely on a test-time fitting (it would make sure that a dedicated API used for this avoiding any confusion).

The only question that might be slightly annoying: what if we fit the pipeline from a single source/single target but with non-default domain labels, like say {-5, 7}, when running predict w/o sample_domain input this will fail (because we assume predict inputs to be targets with a default label). I guess it's okay, in a way you created the problem for yourself. To be sure that what you put into predict is correct, it has to have domain labels attached to it.