[
https://issues.apache.org/jira/browse/SPARK-30504?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Maciej Szymkiewicz updated SPARK-30504:
---------------------------------------
Description:
Current behaviour
{code:python}
from pyspark.ml.classification import LogisticRegression, OneVsRest,
OneVsRestModel
from pyspark.ml.linalg import DenseVector
df = spark.createDataFrame([(0, 1, DenseVector([1.0, 0.0])), (0, 1,
DenseVector([1.0, 0.0]))], ("label", "w", "features"))
ovr = OneVsRest(classifier=LogisticRegression()).setWeightCol("w")
ovrm = ovr.fit(df)
ovr.getWeightCol()
## 'w'
ovrm.getWeightCol()
## 'w'
ovr.write().overwrite().save("/tmp/ovr")
ovr_ = OneVsRest.load("/tmp/ovr")
ovr_.getWeightCol()
## KeyError
## ...
## KeyError: Param(parent='OneVsRest_5145d56b6bd1', name='weightCol',
doc='weight column name. ...)
ovrm.write().overwrite().save("/tmp/ovrm")
ovrm_ = OneVsRestModel.load("/tmp/ovrm")
ovrm_ .getWeightCol()
## KeyError
## ...
## KeyError: Param(parent='OneVsRestModel_598c6d900fad', name='weightCol',
doc='weight column name ...
{code}
Expected behaviour:
{{OneVsRest}} and {{OneVsRestModel}} loaded from disk should have {{weightCol}}.
was:
Current behaviour
{code:python}
from pyspark.ml.classification import LogisticRegression, OneVsRest,
OneVsRestModel
from pyspark.ml.linalg import DenseVector
df = spark.createDataFrame([(0, 1, DenseVector([1.0, 0.0])), (0, 1,
DenseVector([1.0, 0.0]))], ("label", "w", "features"))
ovr = OneVsRest(classifier=LogisticRegression()).setWeightCol("w")
ovrm = ovr.fit(df)
ovr.getWeightCol()
## 'w'
ovrm.getWeightCol()
## 'w'
ovr.write().overwrite().save("/tmp/ovr")
ovr_ = OneVsRest.load("/tmp/ovr")
ovr_.getWeightCol()
## KeyError
## ...
## KeyError: Param(parent='OneVsRest_5145d56b6bd1', name='weightCol',
doc='weight column name. ...)
ovrm.write().overwrite().save("/tmp/ovrm")
ovrm_ = OneVsRestModel.load("/tmp/ovrm")
ovrm_ .getWeightCol()
## KeyError
## ...
## KeyError: Param(parent='OneVsRestModel_598c6d900fad', name='weightCol',
doc='weight column name ...
{code}
Expected behaviour:
{{OneVsRest}} and {{ OneVsRestModel}} loaded from disk should have
{{weightCol}}.
> OneVsRest and OneVsRestModel _from_java and _to_java should handle weightCol
> ----------------------------------------------------------------------------
>
> Key: SPARK-30504
> URL: https://issues.apache.org/jira/browse/SPARK-30504
> Project: Spark
> Issue Type: Bug
> Components: ML, PySpark
> Affects Versions: 3.0.0
> Reporter: Maciej Szymkiewicz
> Priority: Major
>
> Current behaviour
> {code:python}
> from pyspark.ml.classification import LogisticRegression, OneVsRest,
> OneVsRestModel
> from pyspark.ml.linalg import DenseVector
> df = spark.createDataFrame([(0, 1, DenseVector([1.0, 0.0])), (0, 1,
> DenseVector([1.0, 0.0]))], ("label", "w", "features"))
> ovr = OneVsRest(classifier=LogisticRegression()).setWeightCol("w")
> ovrm = ovr.fit(df)
> ovr.getWeightCol()
> ## 'w'
> ovrm.getWeightCol()
> ## 'w'
> ovr.write().overwrite().save("/tmp/ovr")
> ovr_ = OneVsRest.load("/tmp/ovr")
> ovr_.getWeightCol()
> ## KeyError
> ## ...
> ## KeyError: Param(parent='OneVsRest_5145d56b6bd1', name='weightCol',
> doc='weight column name. ...)
> ovrm.write().overwrite().save("/tmp/ovrm")
> ovrm_ = OneVsRestModel.load("/tmp/ovrm")
> ovrm_ .getWeightCol()
> ## KeyError
> ## ...
> ## KeyError: Param(parent='OneVsRestModel_598c6d900fad', name='weightCol',
> doc='weight column name ...
> {code}
> Expected behaviour:
> {{OneVsRest}} and {{OneVsRestModel}} loaded from disk should have
> {{weightCol}}.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]