Github user yinxusen commented on the pull request:

    https://github.com/apache/spark/pull/12604#issuecomment-213578858
  
    @jkbradley There is also a possible enhancement for `OneVsRest`. Currently 
`OneVsRest` requires `classifier` as its parameter, which is not easy-to-use 
especially when using in CrossValidator and TrainValidationSplit.
    
    First, it can not be persisted if the `classifier` param appears in 
`estimatorParamMaps`;
    Second, if we want to wrap OneVsRest in CrossValidator, we need to 
construct the estimatorParamMaps like below:
    ```scala
    ovr = OneVsRest()
    epms = [{ovr.classifier: LogisticRegression(maxIter=5)}, {ovr.classifier: 
LogisticRegression(maxIter=10)}]
    cv = CrossValidator(estimator=ovr, estimatorParamMaps=epms, ...)
    ``` 
    
    So I think, how about to add a estimatorParamMaps param to OneVsRest just 
like what we do in CrossValidator and TrainValidationSplit, say,
    
    ```scala
    lr = LogisticRegression()
    epms = [{lr.maxIter: 5}, {lr.maxIter: 10}]
    ovr = OneVsRest(classifier=lr, estimatorParamMaps=epms)
    ```


---
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