GitHub user mengxr opened a pull request:

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

    [SPARK-1260]: faster construction of features with intercept

    The current implementation uses `Array(1.0, features: _*)` to construct a 
new array with intercept. This is not efficient for big arrays because 
`Array.apply` uses a for loop that iterates over the arguments. `Array.+:` is a 
better choice here.
    
    Also, I don't see a reason to set initial weights to ones. So I set them to 
zeros.
    
    JIRA: https://spark-project.atlassian.net/browse/SPARK-1260

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

    $ git pull https://github.com/mengxr/spark sgd

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

    https://github.com/apache/spark/pull/161.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 #161
    
----
commit a1439c219167eb697ed6b938873c208d75df5677
Author: Xiangrui Meng <[email protected]>
Date:   2014-03-17T17:23:06Z

    faster construction of features with intercept

commit b5cfc530143c71ed4ef6c1b761379e73a5416563
Author: Xiangrui Meng <[email protected]>
Date:   2014-03-17T18:13:01Z

    set default weights to zeros

----


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

Reply via email to