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] Fix Tars & MMDSConS #156

Closed YanisLalou closed 3 months ago

YanisLalou commented 3 months ago

The R matrix is supposed to have a shape of (m, c) with m the len of X_source and c the len of unique y_source. Otherwise we would have ValueErrors line 774 and 1274: R[:, i] = (y_source == c).int() when X_target.shape[0] != len(y_source)

codecov[bot] commented 3 months ago

Codecov Report

Merging #156 (1123aba) into main (0078065) will decrease coverage by 0.36%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #156 +/- ## ========================================== - Coverage 97.49% 97.13% -0.36% ========================================== Files 47 47 Lines 4191 4191 ========================================== - Hits 4086 4071 -15 - Misses 105 120 +15 ```
antoinecollas commented 3 months ago

Changing somewhere make_shifted_datasets(n_samples_source, n_samples_target, ...) with n_samples_source != n_samples_target in the contest.py should be enough no?

YanisLalou commented 3 months ago

Changing somewhere make_shifted_datasets(n_samples_source, n_samples_target, ...) with n_samples_source != n_samples_target in the contest.py should be enough no?

It was already the case i.e n_samples_source=20, n_samples_target=21. Also in that case I can't test when X_source.shape[0] < X_target.shape[0] AND X_source.shape[0] > X_target.shape[0]

rflamary commented 3 months ago

If you want to etst different sizes you shoulh parametrize the datasets instead of doing multiple tests. This is indeed an imprtant test when the two sizes are different and larger/smaller.

antoinecollas commented 3 months ago

An it is strange that n_samples_source != n_samples_target but the tests pass???

rflamary commented 3 months ago

The test take 26 minutes! tu run now, please choose smaller (much smaller) number of smapels to accelerate this and come back to 1-2 minuts.