Github user yanboliang commented on the issue:

    https://github.com/apache/spark/pull/16002
  
    @sethah @srowen Thanks for all your comments. 
    The main reason that I support error code solution is that this fallback is 
not very rare, since ```IterativelyReweightedLeastSquares``` will call 
```WeightedLeastSquares``` in each step. There are some cases that need to 
fallback to ```QuasiNewtonSolver``` multiple times. The worst situation is 
fallback every iteration, like the following example:
    
    
![image](https://cloud.githubusercontent.com/assets/1962026/20712140/bf6daaf6-b5f7-11e6-8f2f-4af2ce8f5479.png)
    
    Actually the singular matrix exception should never be thrown out to users 
currently, since both ```LinearRegression``` and 
```GeneralizedLinearRegression``` call ```WeightedLeastSquares``` with auto 
solver. So the fallback logic can be seen as a conversion mechanism rather than 
exception/error handle mechanism. And for internal usage, I think error code 
should be more efficient.
    To my current change, I agree @sethah 's point that the error code is too 
detail and we can make it more abstract. For example, zero means success, 
otherwise means failure. I'm glad to hear other thoughts as well. Thanks.
    
    



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