scikit-adaptation / skada

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

[MRG] Fix pack when y is a string #197

Closed YanisLalou closed 2 months ago

YanisLalou commented 2 months ago

Issue: When labels in a dataset are string, the pack function raised an error when doing np.ones_like(y) * domain_id: numpy.core._exceptions._UFuncNoLoopError: ufunc 'multiply' did not contain a loop with signature matching types (dtype('<U1'), dtype('int64')) -> None

Fix: Convert the np.ones_like(y)to int instead of following the type of y.