Github user zhengruifeng commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13050#discussion_r62955620
  
    --- 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 --
    
    You are right. `model1.extractParamMap()` and `model2.extractParamMap()` 
are always empty.
    And it fails with 
    ```
    16/05/12 09:58:48 WARN TaskSetManager: Lost task 2.0 in stage 40.0 (TID 
152, localhost): java.lang.IllegalArgumentException: requirement failed: 
Logistic Regression getThreshold found inconsistent values for threshold (0.5) 
and thresholds (equivalent to 0.55)
            at scala.Predef$.require(Predef.scala:224)
            at 
org.apache.spark.ml.classification.LogisticRegressionParams$class.checkThresholdConsistency(LogisticRegression.scala:143)
    ```
    I will revert this change. 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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to