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

[Python] add start_iteration to python predict interface (#3058) #3272

Merged
merged 9 commits into from
Aug 6, 2020

Conversation

shiyu1994
Copy link
Collaborator

Suggested by Issue #3058. Add start_iteration for python prediction.

Copy link
Collaborator

@StrikerRUS StrikerRUS left a comment

Choose a reason for hiding this comment

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

@shiyu1994 Thank you very much! Just some minor comments regarding Python part.

Also, I believe sklearn wrapper should be updated with explicit parameter:

def predict(self, X, raw_score=False, num_iteration=None,

def predict(self, X, raw_score=False, num_iteration=None,

def predict_proba(self, X, raw_score=False, num_iteration=None,

include/LightGBM/config.h Show resolved Hide resolved
python-package/lightgbm/basic.py Outdated Show resolved Hide resolved
python-package/lightgbm/basic.py Outdated Show resolved Hide resolved
python-package/lightgbm/basic.py Outdated Show resolved Hide resolved
@StrikerRUS
Copy link
Collaborator

@shiyu1994 Also, please add some tests that checks new param is working.

Letting know @imatiach-msft about changes in SWIG API.

@guolinke
Copy link
Collaborator

guolinke commented Aug 5, 2020

ping @shiyu1994 for R's test fails:
══ testthat results ═══════════════════════════════════════════════════════════
[ OK: 558 | SKIPPED: 2 | WARNINGS: 0 | FAILED: 7 ]

  1. Failure: start_iteration works correctly (@test_Predictor.R#49)
  2. Failure: start_iteration works correctly (@test_Predictor.R#50)
  3. Failure: train and predict binary classification (@test_basic.R#32)
  4. Error: lgb.intereprete works as expected for binary classification (@test_lgb.interprete.R#38)
  5. Error: lgb.intereprete works as expected for multiclass classification (@test_lgb.interprete.R#89)
  6. Error: lgb.plot.interepretation works as expected for binary classification (@test_lgb.plot.interpretation.R#38)
  7. Error: lgb.plot.interepretation works as expected for multiclass classification (@test_lgb.plot.interpretation.R#87)

@guolinke
Copy link
Collaborator

guolinke commented Aug 6, 2020

@shiyu1994 it seems there are some lint/doc problems.

@shiyu1994
Copy link
Collaborator Author

@jameslamb @StrikerRUS Could you tell me how to update the R documentation in R-package/man folder? It seems that the tests failed due to code/doc mismatch. I try to use roxygen2 and run roxygenise under R-package folder but the following error occurs. Thanks.
error

@guolinke
Copy link
Collaborator

guolinke commented Aug 6, 2020

@shiyu1994
can you try to bulid R package first, then run roxygen2?
https://github.com/microsoft/LightGBM/tree/master/R-package#install

@shiyu1994
Copy link
Collaborator Author

It seems that roxygenise(load = 'installed') works.

@shiyu1994 shiyu1994 force-pushed the fix-3058 branch 2 times, most recently from 8cb28e0 to e19742c Compare August 6, 2020 11:39
@guolinke
Copy link
Collaborator

guolinke commented Aug 6, 2020

I think .Rdata should be removed.

@guolinke
Copy link
Collaborator

guolinke commented Aug 6, 2020

also

The downloaded source packages are in
	‘/tmp/Rtmp3IyK3E/downloaded_packages’
Writing NAMESPACE
Writing NAMESPACE
Writing predict.lgb.Booster.Rd
Some R documentation files have changed. Please re-generate them and commit those changes.

    Rscript build_r.R
    Rscript -e "roxygen2::roxygenize('R-package/', load = 'installed')"

@guolinke
Copy link
Collaborator

guolinke commented Aug 6, 2020

Thank you so much @shiyu1994
@jameslamb @StrikerRUS I am going to merge this. If there are any problems, we can create another PR to fix it.

@github-actions
Copy link

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 Aug 24, 2023
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.

3 participants