Github user zero323 commented on a diff in the pull request: https://github.com/apache/spark/pull/17218#discussion_r107803159 --- Diff: python/pyspark/ml/tests.py --- @@ -1243,6 +1245,43 @@ def test_tweedie_distribution(self): self.assertTrue(np.isclose(model2.intercept, 0.6667, atol=1E-4)) +class FPGrowthTests(SparkSessionTestCase): + def setUp(self): + super(FPGrowthTests, self).setUp() + self.data = self.spark.createDataFrame( + [([1, 2], ), ([1, 2], ), ([1, 2, 3], ), ([1, 3], )], + ["items"]) + + def test_association_rules(self): + fp = FPGrowth() + fpm = fp.fit(self.data) + + expected_association_rules = self.spark.createDataFrame( + [([3], [1], 1.0), ([2], [1], 1.0)], + ["antecedent", "consequent", "confidence"] + ) + actual_association_rules = fpm.associationRules + --- End diff -- I don't think so. I reported this before on the developers list (http://apache-spark-developers-list.1001551.n3.nabble.com/ML-PYTHON-Collecting-data-in-a-class-extending-SparkSessionTestCase-causes-AttributeError-td21120.html) with a minimal example. There is something ugly going on here but it doesn't seem to be related to `FPGrowth` at all.
--- 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