You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mengxr <gi...@git.apache.org> on 2015/02/02 22:21:10 UTC

[GitHub] spark pull request: [SPARK-1406] Mllib pmml model export

Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/3062#issuecomment-72540267
  
    @srowen @selvinsource From user perspective, this is the code they need to export a model to PMML:
    
    ~~~
    import org.apache.spark.mllib.export.ModelExporter
    
    val kmeansModel = ...
    ModelExporter.toPMML(kmeansModel, "/path")
    ~~~
    
    They need to remember two things: 1) `ModelExporter`'s name and its package, 2) whether a model is exportable to PMML or not because `toPMML` takes `Any`. As a user, I would prefer the following
    
    ~~~
    val kmeansModel = ...
    val pmml = kmeansModel.toPMML
    ~~~
    
    We can add a trait called `PMMLExportable`, which contains `toPMML`. (We need to discuss the return type of `toPMML`.) So users know whether a model can be exported to PMML or not. For the implementation, I agree with @srowen that `.pmml` package should be sufficient because there is no other exchangeable formats for predictive models. The real export code for each model should live under this package as private and `toPMML` in each model becomes a simple wrapper.
    
    Due to lacking feature attributes, I'd like to mark everything as private for now until we add ML attributes.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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