Forest serialization - #63
Merged
Merged
Conversation
…uctor Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Post-review hardening of the marshal boundary: - set_model: reject leaf interval matrices narrower than feature_size (previously an unchecked out-of-bounds read on corrupt blobs) - set_grid_leaves: reject non-positive grid dims and values matrices whose dimensions do not match the grid (previously OOB read or silent zero-fill) - set_training_data: reject X/Y shape mismatches (previously reached purify and read out of bounds) - rpf_marshal: record packageVersion(); rpf_unmarshal warns when the blob was written by a newer package version. Blob format version stays the hard compatibility gate. - export_forest objects no longer store the forest twice in the blob; $forest is rebuilt on unmarshal. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Implements #52
Hard requirement to get the mlr3extralearner back.
Unfortunately not entirely trivial and a few scenarios are covered:
blob <- rpf_marshal(fit)predict()works; purification permanently unavailablepurify(fit); blob <- rpf_marshal(fit)predict()andpredict_components()work. No training data stored, no re-purification on loadblob <- rpf_marshal(fit, include_data = TRUE)purify()after restoreIn particular I wanted the "don't care about purification" path because that's important for settings like the benchmark(s) we did in the past where only prediction is relevant and serialization is potentially needed (for encapsulation with
callras done in my large survival benchmark, or maybe parallelization acrossmiraior something along those lines). in that setting forcing purification would be wasted time, same as carrying around the information needed for purification later.