[SPARK-43981][PYTHON][ML] Basic saving / loading implementation for ML on spark connect#41478
Closed
WeichenXu123 wants to merge 17 commits intoapache:masterfrom
Closed
[SPARK-43981][PYTHON][ML] Basic saving / loading implementation for ML on spark connect#41478WeichenXu123 wants to merge 17 commits intoapache:masterfrom
WeichenXu123 wants to merge 17 commits intoapache:masterfrom
Conversation
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
zhengruifeng
reviewed
Jun 8, 2023
| from pyspark.errors import PySparkNotImplementedError, PySparkRuntimeError | ||
| from pyspark.util import VersionUtils | ||
|
|
||
| from pyspark import __version__ as pyspark_version |
Contributor
There was a problem hiding this comment.
on python client, this version info may be different with the one spark.version from the sever side
Contributor
Author
There was a problem hiding this comment.
For new pyspark ML module, I think we should regard it as a client side package so using client side pyspark version should be fine. Pyspark server side just runs wrapped python UDF which is unaware of concrete ML algorithm logic.
python/pyspark/mlv2/io_utils.py
Outdated
| return instance | ||
|
|
||
|
|
||
| class ModelReadWrite: |
Contributor
There was a problem hiding this comment.
ModelReadWrite will not deal with the parameters?
Contributor
Author
There was a problem hiding this comment.
See my latest code, "ModelReadWrite" inherits from "ParamsReadWrite"
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
Signed-off-by: Weichen Xu <weichen.xu@databricks.com>
zhengruifeng
approved these changes
Jun 14, 2023
czxm
pushed a commit
to czxm/spark
that referenced
this pull request
Jun 19, 2023
…L on spark connect ### What changes were proposed in this pull request? * Base class / helper functions for saving/loading estimator / transformer / evaluator / model. * Add saving/loading implementation for feature transformers. * Add saving/loading implementation for logistic regression estimator. Design goals: * The model format is decoupled from spark, i.e. we can run model inference without spark service. * We can save model to either local file system or cloud storage file system. ### Why are the changes needed? We need to support saving/loading estimator / transformer / evaluator / model. ### Does this PR introduce _any_ user-facing change? Yes. ### How was this patch tested? Unit tests. Closes apache#41478 from WeichenXu123/mlv2-read-write. Authored-by: Weichen Xu <weichen.xu@databricks.com> Signed-off-by: Weichen Xu <weichen.xu@databricks.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.
What changes were proposed in this pull request?
Design goals:
Why are the changes needed?
We need to support saving/loading estimator / transformer / evaluator / model.
Does this PR introduce any user-facing change?
Yes.
How was this patch tested?
Unit tests.