Impossible to deserialize a bundle written with Scikit-Learn with Pyspark: no "bundle.json found"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- python, scikit-learn
- Domain
- machine-learning
Research direction
Start with the scikit-learn serialize_to_bundle call and the PySpark RandomForestClassificationModel.deserializeFromBundle entry point shown in the reproduction. Trace the expected bundle layout and determine whether the generated model can be consumed by the Spark reader; done means the compatibility behavior is verified and the missing bundle.json failure is resolved or clearly documented.
Written by the indexing model from the issue text.
Description
I serialize a model with Scikit-Learn:
#Generate data
import pandas as pd
import numpy as np
df = pd.DataFrame(np.random.randn(100, 5), columns=['a', 'b', 'c', 'd', 'e'])
df["y"] = (df['a'] > 0.5).astype(int)
df.head()
from mleap.sklearn.ensemble.forest import RandomForestClassifier
forestModel = RandomForestClassifier()
forestModel.mlinit(input_features='a',
feature_names='a',
prediction_column='e_binary')
forestModel.fit(df[['a']], df[['y']])
forestModel.serialize_to_bundle("/dbfs/FileStore/tables/mleaptestmodelforest", "model.json")
When I try to read it with Pyspark:
from pyspark.ml.classification import RandomForestClassificationModel
model = RandomForestClassificationModel.deserializeFromBundle("file:/dbfs/FileStore/tables/mleaptestmodelforest")
I have this error:
java.nio.file.NoSuchFileException: /dbfs/FileStore/tables/mleaptestmodelforest/bundle.json
I have no "bundle.json".
Could you help me please?
Is it really possible to seralize a model with Scikit-Learn and deserialize it with Pyspark?
- Dominant language
- Scala
- Stars
- 1.5k
- Forks
- 313
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from combust/mleap
-
[Security] Incomplete fix for CVE-2023-5245: zip slip via directory entries in FileUtil.extractOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Question: Alternative to MLeap for Real-Time Inference Without Spark Context with SparkXGBClassifierOpen
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
Similar issues
-
module: backend type: bug/reported
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
OpenXiangShan/XiangShan#6938 ·
Maintainers usually reply within 3 days
-
module: core presentation conversion
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bigbluebutton/bigbluebutton#26508 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day