Skip to content

lightgbm.cv set balanced sample_weights according to each training fold target #7093

@carlosg-m

Description

@carlosg-m

Summary

Just like #5797, there should be a way to set sample weights for each fold. In the case of multiclass objective, the only way to balance classes is to set sample weights for the entire dataset.

The problem is that setting sample_weights on the whole dataset before K-Fold introduces leakage.

Another alternative is the Focal Loss cost function with gamma set to zero and alpha set to class weights. But there is no such cost function in LightGBM.

Motivation

Provide custom sample weights to each lightgbm.cv fold without introducing leakage, for class balancing or other purposes.

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