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

[SPARK-51340][ML][CONNECT] Model size estimation for linear classification & regression models #50106

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

zhengruifeng
Copy link
Contributor

@zhengruifeng zhengruifeng commented Feb 27, 2025

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

  • dataset metadata like numFeatures, numClasses
  • some parameters like modelType in NaiveBayes

We always assume the vectors and matrics are dense, so the actual size might be smaller.

This PR covers:

  • FMClassifer
  • LinearSVC
  • LogisticRegression
  • MultilayerPerceptronClassifier
  • NaiveBayes
  • AFTSurvivalRegression
  • FMRegressor
  • GeneralizedLinearRegression
  • LinearRegression

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant