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

C API refitting #6430

Open
eightreal opened this issue Apr 29, 2024 · 6 comments
Open

C API refitting #6430

eightreal opened this issue Apr 29, 2024 · 6 comments
Labels

Comments

@eightreal
Copy link

eightreal commented Apr 29, 2024

Hello , I have see the LGBM_BoosterRefit api in C-API
is there more description about it? a example code is much better, I 'm try to do continue learning by new data , but there is few doc.

@jameslamb jameslamb changed the title CAPI refitting C API refitting Apr 29, 2024
@eightreal
Copy link
Author

eightreal commented Apr 29, 2024

In python , I see some example code like

refit(data=x_test, label=y_test)

but , how it work in C_Api, how can I get the input

const int32_t* leaf_preds,
int32_t nrow,
int32_t ncol
                                        ```

@eightreal
Copy link
Author

eightreal commented Apr 30, 2024

I read the python source code
So, I need call the LGBM_BoosterPredictForMat to get the leaf index (by my new dataset )
the input leaf index for refit ,
Is the workflow correct?
and whether should I call the LGBM_BoosterResetTrainingData before call refit?

@eightreal
Copy link
Author

OH, I also see you have call a new booster and merge.

@eightreal
Copy link
Author

is there any member can help answer my question?

@jameslamb
Copy link
Collaborator

Please look through what Booster.refit() in the Python package does.

@eightreal
Copy link
Author

I can do refit by this workflow, but I check that you create a empty model and merge old model, so can I reset training dataset directly?

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

No branches or pull requests

2 participants