You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by mengxr <gi...@git.apache.org> on 2014/04/29 01:29:03 UTC

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

GitHub user mengxr opened a pull request:

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

    [SPARK-1636][MLLIB] Move main methods to examples

    * `NaiveBayes` -> `SparseNaiveBayes`
    * `KMeans` -> `DenseKMeans`
    * `SVMWithSGD` and `LogisticRegerssionWithSGD` -> `BinaryClassification`
    * `ALS` -> `MovieLensALS`
    * `LinearRegressionWithSGD`, `LassoWithSGD`, and `RidgeRegressionWithSGD` -> `LinearRegression`
    * `DecisionTree` -> `DecisionTreeRunner`
    
    scopt is used for command-line parameters except `DecisionTreeRunner`.
    
    Example help message:
    
    ~~~
    BinaryClassification: an example app for binary classification.
    Usage: BinaryClassification [options] <input>
    
      --numIterations <value>
            number of iterations
      --stepSize <value>
            initial step size, default: 1.0
      --algorithm <value>
            algorithm (SVM,LR), default: LR
      --regType <value>
            regularization type (L1,L2), default: L2
      --regParam <value>
            regularization parameter, default: 0.1
      <input>
            input paths to labeled examples in LIBSVM format
    ~~~

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

    $ git pull https://github.com/mengxr/spark mllib-main

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

    https://github.com/apache/spark/pull/584.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 #584
    
----
commit 9420692994d75c23560d49039bcf2f75a5225544
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T17:21:39Z

    add scopt to examples dependencies

commit 01ec2cd0c01c809352f5b5dfa39666a9a5ac472b
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T18:19:27Z

    Merge branch 'master' into mllib-main

commit f70878ebf0a8a13cb4da2d6a8b4e37ec7b7df890
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T18:51:53Z

    remove main from NaiveBayes and add an example NaiveBayes app

commit 3d299bc431cd4645258b70f0c3bf495cdc5bf286
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T21:05:18Z

    remove main from LR/SVM and add an example app for binary classification

commit 577945b46f5e9704d2f8ec2e98d0e0a79b40c50a
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T21:06:39Z

    remove unused imports from NB

commit b040f3b22f0e7bd18489b0466b3a2df7921e071b
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T21:29:52Z

    change BinaryClassificationParams to Params

commit b066bbc518be7ef3931c9625cab9030aae74400b
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T21:32:12Z

    remove main from ALS and add MovieLensALS example

commit 67f444831a3af3b9d120e139b54bbb19611ebf72
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T22:03:26Z

    remove main methods from linear regression algorithms and add LinearRegression example

commit fe23dcb32875b3967018c7b68a10362ca86a29f9
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T23:00:07Z

    remove main from KMeans and add DenseKMeans as an example

commit 8bfaa5a49a1ac9c764a778725f832be51c35a9f6
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T23:01:52Z

    change NaiveBayesParams to Params

commit b3edf68894df30921bc4cc87720bc88daf355ccd
Author: Xiangrui Meng <me...@databricks.com>
Date:   2014-04-28T23:15:33Z

    move DecisionTree's main method to examples

----


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41645705
  
    Merged build finished. All automated tests passed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41630230
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14545/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41642740
  
     Merged build triggered. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41641991
  
    Merged build started. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41645707
  
    Merged build finished. All automated tests passed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41645711
  
    
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14553/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41641982
  
     Merged build triggered. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/584#discussion_r12078596
  
    --- Diff: examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala ---
    @@ -0,0 +1,145 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.examples.mllib
    +
    +import org.apache.log4j.{Level, Logger}
    +import scopt.OptionParser
    +
    +import org.apache.spark.{SparkConf, SparkContext}
    +import org.apache.spark.mllib.classification._
    +import org.apache.spark.mllib.evaluation.binary.BinaryClassificationMetrics
    +import org.apache.spark.mllib.util.MLUtils
    +import org.apache.spark.mllib.optimization.{SquaredL2Updater, L1Updater}
    +
    +/**
    + * An example app for binary classification. Run with
    + * {{{
    + * ./bin/run-example org.apache.spark.examples.mllib.BinaryClassification
    + * }}}
    + * If you use it as a template to create your own app, please use `spark-submit` to submit your app.
    + */
    +object BinaryClassification extends App {
    --- End diff --
    
    Done.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41627078
  
     Merged build triggered. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41645710
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14555/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41638848
  
    LGTM. If you can avoid wild card imports for some packages, that'd be great.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by mengxr <gi...@git.apache.org>.
Github user mengxr commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41642652
  
    Made imports explicit except `SparkContext` and enums.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41630226
  
    Merged build finished. All automated tests passed.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41645708
  
    Merged build finished. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:

    https://github.com/apache/spark/pull/584#discussion_r12078549
  
    --- Diff: examples/src/main/scala/org/apache/spark/examples/mllib/BinaryClassification.scala ---
    @@ -0,0 +1,145 @@
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one or more
    + * contributor license agreements.  See the NOTICE file distributed with
    + * this work for additional information regarding copyright ownership.
    + * The ASF licenses this file to You under the Apache License, Version 2.0
    + * (the "License"); you may not use this file except in compliance with
    + * the License.  You may obtain a copy of the License at
    + *
    + *    http://www.apache.org/licenses/LICENSE-2.0
    + *
    + * Unless required by applicable law or agreed to in writing, software
    + * distributed under the License is distributed on an "AS IS" BASIS,
    + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    + * See the License for the specific language governing permissions and
    + * limitations under the License.
    + */
    +
    +package org.apache.spark.examples.mllib
    +
    +import org.apache.log4j.{Level, Logger}
    +import scopt.OptionParser
    +
    +import org.apache.spark.{SparkConf, SparkContext}
    +import org.apache.spark.mllib.classification._
    +import org.apache.spark.mllib.evaluation.binary.BinaryClassificationMetrics
    +import org.apache.spark.mllib.util.MLUtils
    +import org.apache.spark.mllib.optimization.{SquaredL2Updater, L1Updater}
    +
    +/**
    + * An example app for binary classification. Run with
    + * {{{
    + * ./bin/run-example org.apache.spark.examples.mllib.BinaryClassification
    + * }}}
    + * If you use it as a template to create your own app, please use `spark-submit` to submit your app.
    + */
    +object BinaryClassification extends App {
    --- End diff --
    
    I think ti is better to declare a main rather than extending App. It is more familiar to readers from the Java/C land.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41643524
  
     Merged build triggered. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41649174
  
    Thanks. Merged!



---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41645709
  
    All automated tests passed.
    Refer to this link for build results: https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/14554/


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41643530
  
    Merged build started. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41642749
  
    Merged build started. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] spark pull request: [SPARK-1636][MLLIB] Move main methods to examp...

Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:

    https://github.com/apache/spark/pull/584#issuecomment-41627085
  
    Merged build started. 


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---