-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Custom loss with dependent samples #6145
Comments
Thanks for using LightGBM. Nothing about the way the Python package supports custom objective functions assumes independence between observations in the training data, or require you to implement pointwise loss. As described at https://lightgbm.readthedocs.io/en/latest/pythonapi/lightgbm.train.html#lightgbm.train, using Since that function can access the entire training Here's an example of a custom loss function using LightGBM's Python package: LightGBM/examples/python-guide/advanced_example.py Lines 139 to 147 in 8ed371c
|
This issue has been automatically closed because it has been awaiting a response for too long. When you have time to to work with the maintainers to resolve this issue, please post a new comment and it will be re-opened. If the issue has been locked for editing by the time you return to it, please open a new issue and reference this one. Thank you for taking the time to improve LightGBM! |
All the examples I've seen are custom loss function where samples are independent, such as MSE. Sometimes the custom loss has dependency between samples.
The dependency is in batches. Say, we have 1 year of data. For each day, the samples have dependency, but not across different days.
The loss for each day looks like this:
Loss(a day) = (y1-y0)^2 + (y2-y1)^2 + ...
Total loss:
Loss = Loss(day 0) + Loss(day 1) + ...
Is this implementable under current python API? Thank you!
The text was updated successfully, but these errors were encountered: