You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by yanboliang <gi...@git.apache.org> on 2015/11/10 11:07:43 UTC

[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

GitHub user yanboliang opened a pull request:

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

    [SPARK-11629] [ML] [PySpark] [Doc] Python example code for Multilayer Perceptron Classification

    Add Python example code for Multilayer Perceptron Classification, and make example code in user guide document testable.

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

    $ git pull https://github.com/yanboliang/spark spark-11629

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

    https://github.com/apache/spark/pull/9594.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 #9594
    
----
commit c4b1f0b494aadd53d91c4b4d8d5b114a7a98d593
Author: Yanbo Liang <yb...@gmail.com>
Date:   2015-11-10T10:06:27Z

    Python example code for Multilayer Perceptron Classification

----


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-155385037
  
    **[Test build #45514 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45514/consoleFull)** for PR 9594 at commit [`033f35c`](https://github.com/apache/spark/commit/033f35cee01abcae9e9df8f6bf9e6cb9bdc8e731).
     * This patch passes all tests.
     * This patch merges cleanly.
     * This patch adds the following public classes _(experimental)_:\n  * `public class JavaMultilayerPerceptronClassifierExample `\n


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-155385162
  
    Test PASSed.
    Refer to this link for build results (access rights to CI server needed): 
    https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/45514/
    Test 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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-156327617
  
    LGTM. Merged into master and branch-1.6. 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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#discussion_r44752961
  
    --- Diff: examples/src/main/java/org/apache/spark/examples/ml/JavaMultilayerPerceptronClassifierExample.java ---
    @@ -0,0 +1,74 @@
    +/*
    + * 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.ml;
    +
    +// $example on$
    +import org.apache.spark.SparkConf;
    +import org.apache.spark.api.java.JavaSparkContext;
    +import org.apache.spark.sql.SQLContext;
    +import org.apache.spark.api.java.JavaRDD;
    +import org.apache.spark.ml.classification.MultilayerPerceptronClassificationModel;
    +import org.apache.spark.ml.classification.MultilayerPerceptronClassifier;
    +import org.apache.spark.ml.evaluation.MulticlassClassificationEvaluator;
    +import org.apache.spark.mllib.regression.LabeledPoint;
    +import org.apache.spark.mllib.util.MLUtils;
    +import org.apache.spark.sql.DataFrame;
    +// $example off$
    +
    +/**
    + * An example for Multilayer Perceptron Classification.
    + */
    +public class JavaMultilayerPerceptronClassifierExample {
    +
    +  public static void main(String[] args) {
    +    SparkConf conf = new SparkConf().setAppName("JavaMultilayerPerceptronClassifierExample");
    +    JavaSparkContext jsc = new JavaSparkContext(conf);
    +    SQLContext jsql = new SQLContext(jsc);
    +
    +    // $example on$
    +    // Load training data
    +    String path = "data/mllib/sample_multiclass_classification_data.txt";
    +    JavaRDD<LabeledPoint> data = MLUtils.loadLibSVMFile(jsc.sc(), path).toJavaRDD();
    --- End diff --
    
    Good point, I will send a PR.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-155379869
  
    **[Test build #45514 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/45514/consoleFull)** for PR 9594 at commit [`033f35c`](https://github.com/apache/spark/commit/033f35cee01abcae9e9df8f6bf9e6cb9bdc8e731).


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-155377068
  
     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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#discussion_r44751314
  
    --- Diff: examples/src/main/java/org/apache/spark/examples/ml/JavaMultilayerPerceptronClassifierExample.java ---
    @@ -0,0 +1,74 @@
    +/*
    + * 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.ml;
    +
    +// $example on$
    +import org.apache.spark.SparkConf;
    +import org.apache.spark.api.java.JavaSparkContext;
    +import org.apache.spark.sql.SQLContext;
    +import org.apache.spark.api.java.JavaRDD;
    +import org.apache.spark.ml.classification.MultilayerPerceptronClassificationModel;
    +import org.apache.spark.ml.classification.MultilayerPerceptronClassifier;
    +import org.apache.spark.ml.evaluation.MulticlassClassificationEvaluator;
    +import org.apache.spark.mllib.regression.LabeledPoint;
    +import org.apache.spark.mllib.util.MLUtils;
    +import org.apache.spark.sql.DataFrame;
    +// $example off$
    +
    +/**
    + * An example for Multilayer Perceptron Classification.
    + */
    +public class JavaMultilayerPerceptronClassifierExample {
    +
    +  public static void main(String[] args) {
    +    SparkConf conf = new SparkConf().setAppName("JavaMultilayerPerceptronClassifierExample");
    +    JavaSparkContext jsc = new JavaSparkContext(conf);
    +    SQLContext jsql = new SQLContext(jsc);
    +
    +    // $example on$
    +    // Load training data
    +    String path = "data/mllib/sample_multiclass_classification_data.txt";
    +    JavaRDD<LabeledPoint> data = MLUtils.loadLibSVMFile(jsc.sc(), path).toJavaRDD();
    --- End diff --
    
    Not part of this PR, but we should replace `MLUtils.loadLibSVMFile` by `sqlContext.read.format("libsvm").load(...)`. Could you submit another PR after this?


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-155377107
  
    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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

    https://github.com/apache/spark/pull/9594#issuecomment-155385160
  
    Merged build finished. Test 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.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] spark pull request: [SPARK-11629] [ML] [PySpark] [Doc] Python exam...

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

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


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

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org