GitHub user hhbyyh opened a pull request:

    https://github.com/apache/spark/pull/17862

    [SPARK-20602] [ML]Adding LBFGS as optimizer for LinearSVC

    ## What changes were proposed in this pull request?
    
    jira: https://issues.apache.org/jira/browse/SPARK-20602
    
    Currently LinearSVC in Spark only supports OWLQN as the optimizer ( check 
https://issues.apache.org/jira/browse/SPARK-14709). I made comparison between 
LBFGS and OWLQN on several public dataset and found LBFGS converges much faster 
for LinearSVC in most cases.
    The following table presents the number of training iterations and f1 score 
of both optimizers until convergence
    
    
![image](https://cloud.githubusercontent.com/assets/7981698/25721193/6d78005a-30c4-11e7-9431-9e8e4d17776f.png)
    
    data source: 
https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/binary.html
    training code: new LinearSVC().setMaxIter(10000).setTol(1e-6)
    LBFGS requires far less iterations in most cases and probably is a better 
default optimizer.
    
    ## How was this patch tested?
    
     strengthen existing unit tests

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/hhbyyh/spark svclbfgs

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/17862.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #17862
    
----
commit d46e5edfdf5d052c59677f58767bdbe0803dc368
Author: Yuhao Yang <[email protected]>
Date:   2017-05-04T19:13:41Z

    add lbfgs as default optimizer of LinearSVC

----


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