[SPARK-51340][ML][CONNECT] Model size estimation for linear classification & regression models #50106
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.
What changes were proposed in this pull request?
Model size estimation for linear classification & regression models
This PR handles a group of linear models, whose coefficients are vectors and matrics, and their shape can be easily determined by
numFeatures
,numClasses
modelType
inNaiveBayes
We always assume the vectors and matrics are dense, so the actual size might be smaller.
This PR covers:
For remaining classification and regression models:
1, tree models are quite different, will be handled in separate PR;
2,
IsotonicRegression
seems pretty complicated, I need more time to dig into it;3,
OneVsRest
is a meta algorithm which is implemented in client side, no need to handle;Why are the changes needed?
pre-training model size estimation is required to control the model cache at driver
Does this PR introduce any user-facing change?
no
How was this patch tested?
added tests
Was this patch authored or co-authored using generative AI tooling?
no