Skip to content

LogisticRegressionCV handles class weights differently #5450

Closed
@TomDLT

Description

@TomDLT

These two classifiers are not equivalent:

class_weights = compute_class_weight("balanced", np.unique(y), y)
clf1 = LogisticRegressionCV(class_weight="balanced")
clf2 = LogisticRegressionCV(class_weight=class_weights)

Indeed, the first one computes different class_weights for every folds, whereas the second one uses the same class_weights for every folds. That is why have this line

I am working on it

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions