Skip to content

[docs] document how to use a custom objective function via the C API#6396

Merged
jameslamb merged 7 commits intomicrosoft:masterfrom
parsiad:parsiad/objective-custom-doc
Apr 20, 2024
Merged

[docs] document how to use a custom objective function via the C API#6396
jameslamb merged 7 commits intomicrosoft:masterfrom
parsiad:parsiad/objective-custom-doc

Conversation

@parsiad
Copy link
Contributor

@parsiad parsiad commented Mar 31, 2024

Follow-up to #6393.

Clarifies that objective=custom must be provided via parameters in the C API if you want to use a custom objective function and provide gradients/hessians manually.

@parsiad
Copy link
Contributor Author

parsiad commented Mar 31, 2024

@microsoft-github-policy-service agree

@jameslamb jameslamb changed the title Document objective=custom [docs] document how to use a custom objective function via the C API Apr 1, 2024
@jameslamb jameslamb added the doc label Apr 1, 2024
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks for this!

I've updated the title and added a PR description. In the future when you contribute here, please do provide a PR description briefly describing what the PR does and how it improves the project, including links to any other relevant information. This helps maintainers to understand how what the goal is (to provide useful feedback) and helps other people finding the PR in the future (e.g. from search engines or release notes).

After applying the suggestions I left, please run the script we use to automatically generate parameter documentation and the corresponding C++ code.

python ./helpers/parameter_generator.py

@jameslamb jameslamb self-requested a review April 20, 2024 04:49
Copy link
Collaborator

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Thanks very much! I just pushed commits to get this up to date with the latest changes in this repo (now that we've fixed continuous integration), and to split up 2 lines of documentation.

I also changed this from your phrasing:

must be passed through parameters explicitly

to this

must be passed through parameters explicitly in the C API

So that users of the R and Python packages don't get confused and think they need to pass "objective": "custom" (they do not).

👋🏻 Come back and contribute any time!

@jameslamb jameslamb merged commit 89824a6 into microsoft:master Apr 20, 2024
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity since it was closed.
To start a new related discussion, open a new issue at https://github.com/microsoft/LightGBM/issues including a reference to this.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants