dmlc / dmlc/xgboost

Pass sample weights to custom objective functions in the python sklearn interface

Open
#5,768 4 comments 0 reactions 0 assignees View on GitHub
feature-request
Dominant language
C++
Stars
28.8k
Forks
8.9k
Avg merge
1d 12h
Merged PRs (30d)
54

Description

Currently, the python sklearn API for XGBRegessor works by passing the expected arguments for the sklearn-formatted objective function `(ylabel, ypred)` via the decorator `_objective_decorator(func).` This function does not allow for passing sample weights (`dmatrix.get_weight()`) to the custom objective function.

I suggest changing the `_objective_decorator` to allow for custom objective functions that make use of sample weights.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.