Skip to content
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

Add more detailed explanations and tutorial for advanced objectives #10283

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

david-cortes
Copy link
Contributor

@david-cortes david-cortes commented May 13, 2024

This PR expands the docs for custom objectives to cover some important details that are missing about what is or isn't supported.

It also adds a new example guide for advanced usage in which it uses Dirichlet regression as a custom objective (which doesn't meet the requirements of custom objectives for the Hessian), explaining the workarounds that can be used for adapting a model like this as explained in an earlier discussion so that it'd fit into xgboost's framework.

Note: I'm not 100% sure that the .rst file will render correctly. Would be ideal if someone could take a look before merging.

Note2: the tutorial copy-pasted some data from a publication, which was in turn taken from an R package. I added a citation there but I'm not sure if it requires some other additional form of attribution.

@trivialfis trivialfis self-requested a review May 14, 2024 04:58
@trivialfis
Copy link
Member

trivialfis commented May 14, 2024

Would be ideal if someone could take a look before merging.

You can find the "docs/readthedocs.org:xgboost" entry in the CI test list.

@david-cortes
Copy link
Contributor Author

Would be ideal if someone could take a look before merging.

You can find the "docs/readthedocs.org:xgboost" entry in the CI test list.

Thanks, I just checked and it looks correctly rendered.

PR is ready for review.

Copy link
Member

@trivialfis trivialfis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this didactic document! I will try to go through it in the coming days and hope you don't mind if I take my time to understand everything in the doc.

Comment on lines +68 to +70
- Since the ``base_score`` parameter that XGBoost uses for an intercept is
limited to a scalar, one can use the ``base_margin`` functionality instead,
but note that using it requires a bit more effort.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do intend to remove this restriction in the future once we can remove the existing binary serialization #7547 . Might be worth noting.

@david-cortes
Copy link
Contributor Author

Added also R code for all of the examples, but running them will require merging this PR first : #10323

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants