-
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
Add option to keep cv predicted values #283
Comments
@JackStat |
Absolutely. I looked through the code and thought that would be a good strategy as well but I could not find an object that had the holdout data.frame. So it looks like this chunk creates the 3 boosters (assuming 3-fold cv)
Then you can run something with Any help would be appreciated and I will open the pull req. |
@guolinke I looked through the code and I found that predicting form lgb.Dataset hasn't been supported yet. Could you support that when you got time? Otherwise we can not use all cv models to predict on each fold. Below is a simple function that generating cv predictions from original dataset, @JackStat you can use that for your problem, though I think you had figured it out by yourself.
|
@yanyachen I think use them is enough to achieve the CV prediction score. |
Is this related to #828 ? |
lgb.cv would indeed be much more useful if it would return the final predictions. That would e.g. allow to do stacking. |
Here is an R function that will do it if you pass in a obj from lgb.cv:
|
Great job, @programmersims ! Does the function get the best cv prediction? |
Pretty sure it gets the CV prediction from the last stopping round
…On Mon, Mar 25, 2019, 11:52 AM Nam Lê Quang ***@***.***> wrote:
Great job, @programmersims <https://github.com/programmersims> !
Does the function get the best cv prediction?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#283 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOT-C7zd1FCVMN9crl4WKSM5NAOQGNwfks5vaP7NgaJpZM4L3Yff>
.
|
What a pity! How can I just keep the best cv prediction, @programmersims ? |
Closed in favor of being in #2302. We decided to keep all feature requests in one place. Welcome to contribute this feature! Please re-open this issue (or post a comment if you are not a topic starter) if you are actively working on implementing this feature. |
My sincere thanks to @StrikerRUS for unlocking. Motivation and requirementsI know that people (especially, included some Kagglers) want this feature and I want to fix it. There are probably two reasons why people might want to get prediction values of trained models from cv() function. req1. to analyze out-of-fold predictions for training data in more detail. How to fix itI agree with @guolinke mentioned plan. In other words, add a simple way to get trained models. req1: cv() function can accept 'folds' (context of data split), therefore users can predict of out-of-fold with trained models. Steps to fix itI want to follow scikit-learn way. In other words, trained models are included to the dictionary of return value. I suggest the following steps:
I would like to have your opinion. |
@momijiame Thank you very much for your detailed plan! It looks good to me! Looking forward to your PR. @matsuken92 Maybe you have something in the mind that can improve the proposed PR's plan? |
@StrikerRUS Okay, I will review this plan ! |
…283,#2105,#1445) (#3204) * [python] add return_cvbooster flag to cv function and rename _CVBooster to make public (#283,#2105) * [python] Reduce expected metric of unit testing * [docs] add the CVBooster to the documentation * [python] reflect the review comments - Add some clarifications to the documentation - Rename CVBooster.append to make private - Decrease iteration rounds of testing to save CI time - Use CVBooster as root member of lgb * [python] add more checks in testing for cv Co-authored-by: Nikita Titov <[email protected]> * [python] add docstring for instance attributes of CVBooster Co-authored-by: Nikita Titov <[email protected]> * [python] fix docstring Co-authored-by: Nikita Titov <[email protected]> Co-authored-by: Nikita Titov <[email protected]>
Implemented in #3204. |
Forgive me if I missed something but I have review the code and documentation and didn't see a way to keep the cv probabilities.
The text was updated successfully, but these errors were encountered: