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

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

Merged
merged 7 commits into from
Apr 20, 2024

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

@parsiad parsiad force-pushed the parsiad/objective-custom-doc branch from f46ad0b to b10c669 Compare March 31, 2024 12:57
@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

include/LightGBM/config.h Outdated Show resolved Hide resolved
include/LightGBM/config.h Outdated Show resolved Hide resolved
@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
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants