spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mengxr <>
Subject [GitHub] spark pull request: [SPARK-5094][MLlib] Add Python API for Gradien...
Date Wed, 28 Jan 2015 08:08:21 GMT
Github user mengxr commented on a diff in the pull request:
    --- Diff: examples/src/main/python/mllib/ ---
    @@ -0,0 +1,82 @@
    +# 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
    +# 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.
    +Gradient boosted Trees classification and regression using MLlib.
    +import sys
    +from pyspark.context import SparkContext
    +from pyspark.mllib.tree import GradientBoostedTrees
    +from pyspark.mllib.util import MLUtils
    +def testClassification(trainingData, testData):
    +    # Train a GradientBoostedTrees model.
    +    #  Empty categoricalFeaturesInfo indicates all features are continuous.
    +    model = GradientBoostedTrees.trainClassifier(trainingData,
    +                                                 categoricalFeaturesInfo={},
    +                                                 numIterations=30,
    +                                                 maxDepth=4)
    --- End diff --
    For the code style, we don't chop down arguments in method calls. For example:
    So this should be 
        model = GradientBoostedTrees.trainClassifier(trainingData, categoricalFeaturesInfo={},
                 numIterations=30, maxDepth=4)
        model = GradientBoostedTrees.trainClassifier(
                 trainingData, categoricalFeaturesInfo={}, numIterations=30, maxDepth=4)

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

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message