spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Joseph K. Bradley (JIRA)" <>
Subject [jira] [Commented] (SPARK-5981) pyspark ML models should support predict/transform on vector within map
Date Thu, 05 Mar 2015 18:34:38 GMT


Joseph K. Bradley commented on SPARK-5981:

I'd recommend exploring the code path used for DecisionTreeModel.  Here's a sketch:
* DecisionTreeModel.predict(PythonRDD) (driver) (Python)
** (driver) (Python)
*** Fetches JVM model's method (driver) (Python)
*** PythonRDD gets converted to a Scala RDD (This will become little tasks on the workers
to materialize the RDD.)
*** DecisionTreeModel.predict(RDD) (driver) (Scala)
**** Everything here happens as usual in the JVM  (This includes predict(Vector) on the workers.)

Does that help?

> pyspark ML models should support predict/transform on vector within map
> -----------------------------------------------------------------------
>                 Key: SPARK-5981
>                 URL:
>             Project: Spark
>          Issue Type: Improvement
>          Components: MLlib, PySpark
>    Affects Versions: 1.3.0
>            Reporter: Joseph K. Bradley
> Currently, most Python models only have limited support for single-vector prediction.
> E.g., one can call {code}model.predict(myFeatureVector){code} for a single instance,
but that fails within a map for Python ML models and transformers which use JavaModelWrapper:
> {code}
> features: model.predict(features))
> {code}
> This fails because uses the SparkContext (within the transformation).
 (It works for linear models, which do prediction within Python.)
> Supporting prediction within a map would require storing the model and doing prediction/transformation
within Python.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message