-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-package] [R-package] include more params in model text representation (fixes #6010) #6077
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just a suggestion
Co-authored-by: José Morales <jmoralz92@gmail.com>
stop(error_msg) | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested both sides of this, like this:
.expect_in <- function(x, y) {
if (exists("expect_in")) {
expect_in(x, y)
} else {
missing_items <- x[!(x %in% y)]
if (length(missing_items) != 0L) {
error_msg <- paste0("Some expected items not found: ", toString(missing_items))
stop(error_msg)
}
}
}
# testthat not loaded
.expect_in(c("a", "b"), c("d", "a", "a"))
Error in .expect_in(c("a", "b"), c("d", "a", "a")) :
Some expected items not found: b
# testthat loaded
library(testthat)
.expect_in(c("a", "b"), c("d", "a", "a"))
Error:
x
(actual
) isn't fully contained withiny
(expected
).
- Missing from
expected
: "b"- Present in
expected
: "d", "a", "a"
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. |
Fixes #6010.
Proposes adding the following parameters to the set written to model text files (and therefore also the set preserved by pickling/unpickled in Python and
saveRDS() / readRDS()
in R):It also refactors the
include/config.h
mechanism, to make the relationship between that file,src/config_auto.cpp
, and the Parameter docs clearer.Notes for Reviewers
This PR was mainly inspired by #6017 (comment), but it's informed by many prior conversations related to this topic: