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

option to disable the shape checking in prediction. #2669

Merged
merged 6 commits into from
Jan 7, 2020

Conversation

guolinke
Copy link
Collaborator

@guolinke guolinke commented Jan 6, 2020

to fix #2668


- used only in ``prediction`` task

- if ``true``, will disable the shape checking in prediction. This is dangerous, please aware what you are doing
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it would be valuable to elaborate on which "shape checking" this refers to. I didn't know until I read the text of the error message in the diff.

Would you consider something like this?

Control whether or not LightGBM raises an error when you try to predict on data with a different number of features than the training data. If false (the default), a fatal error will be raised if the number of features in the dataset you predict on differs from the number seen during training. If true, LightGBM will attempt to predict on whatever data you provide. This is dangerous because you might get incorrect predictions, but you could use it in situations where it is difficult or expensive to generate some features and you are very confident that they were never chosen for splits in the model. Be very careful setting this parameter to true.

Copy link
Collaborator

@jameslamb jameslamb Jan 6, 2020

Choose a reason for hiding this comment

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

Also, I am sort of guessing what the context is for this PR, but if you could give a more specific example for when it would be good to set this to true I think it would help users.

Ok I understand more after reading #2668 . But my comment above about elaborating in the documentation stands.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks @jameslamb for detailed documentation!

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.

Some stylish fixes according to our conventions:

include/LightGBM/config.h Outdated Show resolved Hide resolved
include/LightGBM/config.h Outdated Show resolved Hide resolved
include/LightGBM/config.h Outdated Show resolved Hide resolved
src/application/predictor.hpp Outdated Show resolved Hide resolved
src/application/predictor.hpp Outdated Show resolved Hide resolved
src/c_api.cpp Outdated Show resolved Hide resolved
src/c_api.cpp Outdated Show resolved Hide resolved
src/c_api.cpp Outdated Show resolved Hide resolved
src/c_api.cpp Outdated Show resolved Hide resolved
guolinke and others added 2 commits January 7, 2020 09:50
Co-Authored-By: Nikita Titov <nekit94-08@mail.ru>
Co-Authored-By: Nikita Titov <nekit94-08@mail.ru>
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 the updates to the documentation. Looks good to me!

@StrikerRUS StrikerRUS merged commit f6b8ecf into master Jan 7, 2020
@StrikerRUS StrikerRUS deleted the non-shape-check-opt branch January 7, 2020 19:23
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants