Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/8518#discussion_r38268904
--- Diff: docs/ml-guide.md ---
@@ -340,28 +325,23 @@ for (Row r: results.select("features", "label",
"myProbability", "prediction").c
+ ", prediction=" + r.get(3));
}
-jsc.stop();
{% endhighlight %}
</div>
<div data-lang="python">
{% highlight python %}
-from pyspark import SparkContext
-from pyspark.mllib.regression import LabeledPoint
+from pyspark.mllib.linalg import Vectors
from pyspark.ml.classification import LogisticRegression
from pyspark.ml.param import Param, Params
-from pyspark.sql import Row, SQLContext
-
-sc = SparkContext(appName="SimpleParamsExample")
-sqlContext = SQLContext(sc)
# Prepare training data.
# We use LabeledPoint.
-# Spark SQL can convert RDDs of LabeledPoints into DataFrames.
-training = sc.parallelize([LabeledPoint(1.0, [0.0, 1.1, 0.1]),
- LabeledPoint(0.0, [2.0, 1.0, -1.0]),
- LabeledPoint(0.0, [2.0, 1.3, 1.0]),
- LabeledPoint(1.0, [0.0, 1.2, -0.5])])
+# Spark SQL can convert a list of LabeledPoints into DataFrames.
--- End diff --
okay
---
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.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]