spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "zhengruifeng (Jira)" <j...@apache.org>
Subject [jira] [Updated] (SPARK-30378) FM support getter of training prams
Date Sun, 29 Dec 2019 05:22:00 GMT

     [ https://issues.apache.org/jira/browse/SPARK-30378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

zhengruifeng updated SPARK-30378:
---------------------------------
    Description: 
{code:java}
In [1]: from pyspark.ml.linalg import Vectors

In [2]: from pyspark.ml.classification import FMClassifier

In [3]: df = spark.createDataFrame([(1.0, Vectors.dense(1.0)),(0.0, Vectors.sparse(1, [],
[]))], ["label", "features"])

In [4]: fm = FMClassifier(factorSize=2, seed=11)

In [5]: model = fm.fit(df)
19/12/29 13:17:27 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
19/12/29 13:17:27 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS

In [6]: fm.getMaxIter()
Out[6]: 100

In [7]: model.getMaxIter()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-e01eaba831a3> in <module>()
----> 1 model.getMaxIter()AttributeError: 'FMClassificationModel' object has no attribute
'getMaxIter'

 {code}
 

It seems that we should modifiy the newly added FMs in the py side, to keep in line with other
algs.

It is quite similar to your prevous work, would you like to work on this? [~huaxingao]

 

  was:
{code:java}
In [1]: from pyspark.ml.linalg import VectorsIn [2]: from pyspark.ml.classification import
FMClassifierIn [3]: df = spark.createDataFrame([(1.0, Vectors.dense(1.0)),(0.0, Vectors.sparse(1,
[], []))], ["label", "features"])In [4]: fm = FMClassifier(factorSize=2, seed=11)In [5]: model
= fm.fit(df)
19/12/29 13:17:27 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
19/12/29 13:17:27 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLASIn
[6]: fm.getMaxIter()
Out[6]: 100In [7]: model.getMaxIter()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-7-e01eaba831a3> in <module>()
----> 1 model.getMaxIter()AttributeError: 'FMClassificationModel' object has no attribute
'getMaxIter'

 {code}
 

It seems that we should modifiy the newly added FMs in the py side, to keep in line with other
algs.

It is quite similar to your prevous work, would you like to work on this? [~huaxingao]

 


> FM support getter of training prams
> -----------------------------------
>
>                 Key: SPARK-30378
>                 URL: https://issues.apache.org/jira/browse/SPARK-30378
>             Project: Spark
>          Issue Type: Improvement
>          Components: ML, PySpark
>    Affects Versions: 3.0.0
>            Reporter: zhengruifeng
>            Priority: Minor
>
> {code:java}
> In [1]: from pyspark.ml.linalg import Vectors
> In [2]: from pyspark.ml.classification import FMClassifier
> In [3]: df = spark.createDataFrame([(1.0, Vectors.dense(1.0)),(0.0, Vectors.sparse(1,
[], []))], ["label", "features"])
> In [4]: fm = FMClassifier(factorSize=2, seed=11)
> In [5]: model = fm.fit(df)
> 19/12/29 13:17:27 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeSystemBLAS
> 19/12/29 13:17:27 WARN BLAS: Failed to load implementation from: com.github.fommil.netlib.NativeRefBLAS
> In [6]: fm.getMaxIter()
> Out[6]: 100
> In [7]: model.getMaxIter()
> ---------------------------------------------------------------------------
> AttributeError                            Traceback (most recent call last)
> <ipython-input-7-e01eaba831a3> in <module>()
> ----> 1 model.getMaxIter()AttributeError: 'FMClassificationModel' object has no attribute
'getMaxIter'
>  {code}
>  
> It seems that we should modifiy the newly added FMs in the py side, to keep in line with
other algs.
> It is quite similar to your prevous work, would you like to work on this? [~huaxingao]
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org


Mime
View raw message