Skip to content

TST Check correct interactions of class_weight and sample_weight #21504

@jjerphan

Description

@jjerphan

In scikit-learn, some estimators support class_weight and sample_weight.

It might be worth testing the correct interaction of those two types of weights, especially asserting that:

  • setting a class weights to zero is equivalent to excluding the samples associated to this class from the calibration even when using non uniform sample weights.
  • setting some samples weights to zero is equivalent to excluding those samples from the calibration even when if they are associated to using non uniform class weights.

Relevant interfaces:

  • the main subclasses of sklearn.tree.BaseDecisionTree for classification, i.e.:
    • sklearn.tree.DecisionTreeClassifier
    • sklearn.tree.ExtraTreeClassifier
  • the main subclasses of sklearn.ensemble.BaseForest for classification and embedding, i.e.:
    • sklearn.ensemble.RandomTreesEmbedding
    • sklearn.ensemble.RandomForestClassifier
    • sklearn.ensemble.ExtraTreesClassifier
  • sklearn.linear_model.LogisticRegression
  • sklearn.linear_model.LogisticRegressionCV
  • sklearn.CalibratedClassifierCV after the merge of [MRG] Add class_weight parameter to CalibratedClassifierCV #17541

Metadata

Metadata

Assignees

No one assigned

    Labels

    Meta-issueGeneral issue associated to an identified list of tasksModerateAnything that requires some knowledge of conventions and best practiceshelp wantedmodule:test-suiteeverything related to our tests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions