spark-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajay Saini (JIRA)" <>
Subject [jira] [Commented] (SPARK-17025) Cannot persist PySpark ML Pipeline model that includes custom Transformer
Date Wed, 26 Jul 2017 17:41:01 GMT


Ajay Saini commented on SPARK-17025:

I'm currently working on a solution to this that involves building custom persistence support
for Python-only pipeline stages. As of now, you cannot persist a pipeline stage in Python
unless there is a Java implementation of that stage. The framework I'm working on will make
it much easier to implement Python-only persistence of custom stages so that they don't need
to rely on Java.

> Cannot persist PySpark ML Pipeline model that includes custom Transformer
> -------------------------------------------------------------------------
>                 Key: SPARK-17025
>                 URL:
>             Project: Spark
>          Issue Type: New Feature
>          Components: ML, PySpark
>    Affects Versions: 2.0.0
>            Reporter: Nicholas Chammas
>            Priority: Minor
> Following the example in [this Databricks blog post|]
under "Python tuning", I'm trying to save an ML Pipeline model.
> This pipeline, however, includes a custom transformer. When I try to save the model,
the operation fails because the custom transformer doesn't have a {{_to_java}} attribute.
> {code}
> Traceback (most recent call last):
>   File ".../", line 56, in <module>
>   File "/usr/local/Cellar/apache-spark/2.0.0/libexec/python/lib/",
line 222, in save
>   File "/usr/local/Cellar/apache-spark/2.0.0/libexec/python/lib/",
line 217, in write
>   File "/usr/local/Cellar/apache-spark/2.0.0/libexec/python/lib/",
line 93, in __init__
>   File "/usr/local/Cellar/apache-spark/2.0.0/libexec/python/lib/",
line 254, in _to_java
> AttributeError: 'PeoplePairFeaturizer' object has no attribute '_to_java'
> {code}
> Looking at the source code for [ml/|],
I see that not even the base Transformer class has such an attribute.
> I'm assuming this is missing functionality that is intended to be patched up (i.e. [like
> I'm not sure if there is an existing JIRA for this (my searches didn't turn up clear

This message was sent by Atlassian JIRA

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

View raw message