Github user MLnick commented on the issue:

    https://github.com/apache/spark/pull/9207
  
    @holden that's true for the fully generic approach. But `DataFrameWriter` 
for example exposes `json` as a shortcut (type-safe in a way) for 
`format("json")`.
    
    I think we can achieve something similar here, but since each impl of 
`MLWriter` is different for each model, I think we can have a `PMML` trait 
attached to those that support it, enabling the "type-safe" approach: 
`model.write.pmml.save("/path")`.
    
    `model.write.save("/path")` does the default built-in format, 
`model.write.pmml.save("/path")` does pmml for those models that actually 
support it using the trait. For generics, it's possible to do 
`model.write.format("pmml").save(...)` and it would then fail at runtime if not 
supported, while `model.write.format("my.custom.format").save(...)` could allow 
plugging in writers similar to the datasource API...
    
    just thoughts, obviously more work will be required to see if it is 
feasible in practice.


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to