Github user selvinsource commented on the pull request:

    https://github.com/apache/spark/pull/3062#issuecomment-96157430
  
    @mengxr 
    3)
    I have done point 3, if it is a multinomial logistic regression the export 
will cause an IllegalArgumentException. I didn't realize now Logistic supports 
multiple classes. As you said we can add support for this in a new PR.
    
    1)
    For `LogisticRegressionModel` I do use `functionName =  "classification"`, 
see an example of an exported model
    
https://github.com/selvinsource/spark-pmml-exporter-validator/blob/master/src/main/resources/exported_pmml_models/logisticregression.xml
 
    This can be loaded using JPMML as `ClassificationMap`, see
    
https://github.com/selvinsource/spark-pmml-exporter-validator/blob/master/src/main/java/org/selvinsource/spark_pmml_exporter_validator/SparkPMMLExporterValidator.java
    
    For `SVMModel`, I did look into exporting it as a PMML classification 
`RegressionModel` like I did with the `LogisticRegressionModel`, however there 
isn't a PMML `normalizationMethod` that I can use, they all convert the 
prediction into probability and `SVMModel` simply compare a scalar to a 
threshold.
    Because of this I added a comment in the exported regression model: "linear 
SVM: if predicted value > 0, the outcome is positive, or negative otherwise".
    
    2)
    I don't see PMML `RegressionModel` supporting a threshold, @vruusmann can 
you confirm this is the case, or am I missing something :)?
    For `SVMModel` export I could add it to the comment, now it is hard coded 
to 0 but could be "linear SVM: if predicted value > `threshold variable` the 
outcome is positive, or negative otherwise".
    



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