Github user HyukjinKwon commented on a diff in the pull request:
https://github.com/apache/spark/pull/13050#discussion_r62861788
--- Diff: examples/src/main/python/ml/simple_params_example.py ---
@@ -18,36 +18,30 @@
from __future__ import print_function
import pprint
-import sys
-from pyspark import SparkContext
from pyspark.ml.classification import LogisticRegression
from pyspark.mllib.linalg import DenseVector
-from pyspark.mllib.regression import LabeledPoint
-from pyspark.sql import SQLContext
+from pyspark.sql import SparkSession
"""
-A simple example demonstrating ways to specify parameters for Estimators
and Transformers.
+An example demonstrating ways to specify parameters for Estimators and
Transformers.
Run with:
bin/spark-submit examples/src/main/python/ml/simple_params_example.py
"""
if __name__ == "__main__":
- if len(sys.argv) > 1:
- print("Usage: simple_params_example", file=sys.stderr)
- exit(1)
- sc = SparkContext(appName="PythonSimpleParamsExample")
- sqlContext = SQLContext(sc)
+ spark = SparkSession \
--- End diff --
I wonder this rxample works. I remember this was not fixed in
https://github.com/apache/spark/pull/12809 because it does not work.
---
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]