-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Save model in ubj as the default. #9947
Merged
Merged
Changes from 18 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
6ae8899
Save model in ubj as the default.
trivialfis 9fa11cf
Fix.
trivialfis 0c5ccd0
Split up tests.
trivialfis 4234e3f
Error message.
trivialfis 212e159
Lint.
trivialfis 1fad432
Change jvm.
trivialfis f95d35f
Remove all warnings.
trivialfis 3f70069
fix.
trivialfis 7085566
deprecated.
trivialfis ceba76f
global variables.
trivialfis 6ff9452
Fix warnings.
trivialfis 9061201
Classifier.
trivialfis de61048
Revert.
trivialfis 10703dd
Document.
trivialfis 75857a1
typing.
trivialfis 4de52c1
Cleanup test.
trivialfis faa59ec
Move one more test.
trivialfis ae0a674
cleanup.
trivialfis 9d4e5b0
Outdated comments.
trivialfis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1313,10 +1313,8 @@ XGB_DLL int XGBoosterLoadModel(BoosterHandle handle, const char* fname) { | |
|
||
namespace { | ||
void WarnOldModel() { | ||
if (XGBOOST_VER_MAJOR >= 2) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The version is lowered since we have released an extra 1.7 release. The original plan was to go from 1.6 to 2.0 |
||
LOG(WARNING) << "Saving into deprecated binary model format, please consider using `json` or " | ||
"`ubj`. Model format will default to JSON in XGBoost 2.2 if not specified."; | ||
} | ||
LOG(WARNING) << "Saving into deprecated binary model format, please consider using `json` or " | ||
"`ubj`. Model format is default to UBJSON in XGBoost 2.1 if not specified."; | ||
} | ||
} // anonymous namespace | ||
|
||
|
@@ -1339,14 +1337,14 @@ XGB_DLL int XGBoosterSaveModel(BoosterHandle handle, const char *fname) { | |
save_json(std::ios::out); | ||
} else if (common::FileExtension(fname) == "ubj") { | ||
save_json(std::ios::binary); | ||
} else if (XGBOOST_VER_MAJOR == 2 && XGBOOST_VER_MINOR >= 2) { | ||
LOG(WARNING) << "Saving model to JSON as default. You can use file extension `json`, `ubj` or " | ||
"`deprecated` to choose between formats."; | ||
save_json(std::ios::out); | ||
} else { | ||
} else if (common::FileExtension(fname) == "deprecated") { | ||
WarnOldModel(); | ||
auto *bst = static_cast<Learner *>(handle); | ||
bst->SaveModel(fo.get()); | ||
} else { | ||
LOG(WARNING) << "Saving model in the UBJSON format as default. You can use file extension:" | ||
" `json`, `ubj` or `deprecated` to choose between formats."; | ||
save_json(std::ios::binary); | ||
} | ||
API_END(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Removed since the composite strategy cannot be pickled. joblib has been issuing warnings for a while.