Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] Add DomainAndLabelStratifiedSubsampleTransformer + Fix DomainStratifiedSubsampleTransformer #268

Merged

Conversation

YanisLalou
Copy link
Collaborator

@YanisLalou YanisLalou commented Oct 25, 2024

  • Fix TypeError: DomainStratifiedSubsampleTransformer.transform() got an unexpected keyword argument 'allow_source'with DomainStratifiedSubsampleTransformer
  • Add DomainAndLabelStratifiedSubsampleTransformer to have a transformer preserving the percentage of samples
    for each class and for each sample domain (To prevent issues like: ValueError: This solver needs samples of at least 2 classes in the data, but the data contains only one class: 1)

@YanisLalou YanisLalou changed the title Add DomainAndLabelStratifiedSubsampleTransformer + Fix DomainStratifiedSubsampleTransformer [TO_REVIEW] Add DomainAndLabelStratifiedSubsampleTransformer + Fix DomainStratifiedSubsampleTransformer Oct 25, 2024
@antoinecollas
Copy link
Collaborator

Then, we have to be consistent with the splitters. IMO, we have to rename the subsamplers as:

  • DomainStratifiedSubsampleTransformer --> DomainSubsampleTransformer
  • DomainAndLabelStratifiedSubsampleTransformer --> StratifiedDomainSubsampleTransformer

@antoinecollas
Copy link
Collaborator

antoinecollas commented Oct 25, 2024

BTW, we can even get rid of 'Transformer':

  • SubsampleTransformer --> Subsampler
  • DomainStratifiedSubsampleTransformer --> DomainSubsampler
  • DomainAndLabelStratifiedSubsampleTransformer --> StratifiedDomainSubsampler

@YanisLalou
Copy link
Collaborator Author

I agree

@antoinecollas antoinecollas changed the title [TO_REVIEW] Add DomainAndLabelStratifiedSubsampleTransformer + Fix DomainStratifiedSubsampleTransformer [MRG] Add DomainAndLabelStratifiedSubsampleTransformer + Fix DomainStratifiedSubsampleTransformer Oct 25, 2024
@YanisLalou YanisLalou merged commit 9a976ce into scikit-adaptation:main Oct 25, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants