diff options
author | Ram Sriharsha <rsriharsha@hw11853.local> | 2015-06-02 18:53:04 -0700 |
---|---|---|
committer | Joseph K. Bradley <joseph@databricks.com> | 2015-06-02 18:53:04 -0700 |
commit | c3f4c3257194ba34ccd298d13ea1edcfc75f7552 (patch) | |
tree | dd1155697c003e0af5ab98c847473229bf071bab /examples/src/main/python/ml/simple_params_example.py | |
parent | 5cd6a63d9692d153751747e0293dc030d73a6194 (diff) | |
download | spark-c3f4c3257194ba34ccd298d13ea1edcfc75f7552.tar.gz spark-c3f4c3257194ba34ccd298d13ea1edcfc75f7552.tar.bz2 spark-c3f4c3257194ba34ccd298d13ea1edcfc75f7552.zip |
[SPARK-7387] [ML] [DOC] CrossValidator example code in Python
Author: Ram Sriharsha <rsriharsha@hw11853.local>
Closes #6358 from harsha2010/SPARK-7387 and squashes the following commits:
63efda2 [Ram Sriharsha] more examples for classifier to distinguish mapreduce from spark properly
aeb6bb6 [Ram Sriharsha] Python Style Fix
54a500c [Ram Sriharsha] Merge branch 'master' into SPARK-7387
615e91c [Ram Sriharsha] cleanup
204c4e3 [Ram Sriharsha] Merge branch 'master' into SPARK-7387
7246d35 [Ram Sriharsha] [SPARK-7387][ml][doc] CrossValidator example code in Python
Diffstat (limited to 'examples/src/main/python/ml/simple_params_example.py')
-rw-r--r-- | examples/src/main/python/ml/simple_params_example.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/src/main/python/ml/simple_params_example.py b/examples/src/main/python/ml/simple_params_example.py index 3933d59b52..a9f29dab2d 100644 --- a/examples/src/main/python/ml/simple_params_example.py +++ b/examples/src/main/python/ml/simple_params_example.py @@ -41,8 +41,8 @@ if __name__ == "__main__": # prepare training data. # We create an RDD of LabeledPoints and convert them into a DataFrame. - # Spark DataFrames can automatically infer the schema from named tuples - # and LabeledPoint implements __reduce__ to behave like a named tuple. + # A LabeledPoint is an Object with two fields named label and features + # and Spark SQL identifies these fields and creates the schema appropriately. training = sc.parallelize([ LabeledPoint(1.0, DenseVector([0.0, 1.1, 0.1])), LabeledPoint(0.0, DenseVector([2.0, 1.0, -1.0])), |