Skip to content

[SPARK-48998][ML] Meta algorithms save/load model with SparkSession#47477

Closed
zhengruifeng wants to merge 2 commits into
apache:masterfrom
zhengruifeng:ml_meta_spark
Closed

[SPARK-48998][ML] Meta algorithms save/load model with SparkSession#47477
zhengruifeng wants to merge 2 commits into
apache:masterfrom
zhengruifeng:ml_meta_spark

Conversation

@zhengruifeng

@zhengruifeng zhengruifeng commented Jul 25, 2024

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

  1. add overloads with SparkSession of following helper functions:
  • SharedReadWrite.saveImpl
  • SharedReadWrite.load
  • DefaultParamsWriter.getMetadataToSave
  • DefaultParamsReader.loadParamsInstance
  • DefaultParamsReader.loadParamsInstanceReader
  1. deprecate old functions
  2. apply the new functions in ML

Why are the changes needed?

Meta algorithms save/load model with SparkSession

After this PR, all .ml implementations save and load models with SparkSession, while the old helper functions with sc are still available (just deprecated) for eco-system.

Does this PR introduce any user-facing change?

No

How was this patch tested?

CI

Was this patch authored or co-authored using generative AI tooling?

No

@zhengruifeng

Copy link
Copy Markdown
Contributor Author

merged to master

@zhengruifeng zhengruifeng deleted the ml_meta_spark branch July 26, 2024 10:18

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM. Thank you, @zhengruifeng and @HyukjinKwon .

ilicmarkodb pushed a commit to ilicmarkodb/spark that referenced this pull request Jul 29, 2024
### What changes were proposed in this pull request?

1. add overloads with SparkSession of following helper functions:

- SharedReadWrite.saveImpl
- SharedReadWrite.load
- DefaultParamsWriter.getMetadataToSave
- DefaultParamsReader.loadParamsInstance
- DefaultParamsReader.loadParamsInstanceReader

2. deprecate old functions
3. apply the new functions in ML

### Why are the changes needed?
Meta algorithms save/load model with SparkSession

After this PR, all `.ml` implementations save and load models with SparkSession, while the old helper functions with `sc` are still available (just deprecated) for eco-system.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
CI

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#47477 from zhengruifeng/ml_meta_spark.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Ruifeng Zheng <ruifengz@apache.org>
HyukjinKwon pushed a commit that referenced this pull request Jul 30, 2024
…t spark session

### What changes were proposed in this pull request?
Make model save/load helper functions accept spark session

### Why are the changes needed?
1, avoid unnecessary spark session creations;
2, to be consistent with scala side changes: #47467 and #47477

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
CI

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #47527 from zhengruifeng/py_ml_save_metadata_spark.

Authored-by: Ruifeng Zheng <ruifengz@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants