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

    https://github.com/apache/spark/pull/17922#discussion_r123768466
  
    --- Diff: python/pyspark/ml/tests.py ---
    @@ -832,6 +860,96 @@ def test_logistic_regression(self):
             except OSError:
                 pass
     
    +    def logistic_regression_check_thresholds(self):
    +        self.assertIsInstance(
    +            LogisticRegression(threshold=0.5, thresholds=[0.5, 0.5]),
    +            LogisticRegressionModel
    +        )
    +
    +        self.assertRaisesRegexp(
    +            ValueError,
    +            "Logistic Regression getThreshold found inconsistent.*$",
    +            LogisticRegression, threshold=0.42, thresholds=[0.5, 0.5]
    +        )
    +
    +    def test_binomial_logistic_regression_bounds(self):
    --- End diff --
    
    For PySpark, we should only check the output is consistent with Scala. The 
most straight-forward way for this test should be loading data directly and run 
constraint LR on it:
    ```
    data_path = "data/mllib/sample_multiclass_classification_data.txt"
    df = spark.read.format("libsvm").load(data_path)
    ......
    ```
    This will make the test case simple and time-saving. 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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to