huaxingao commented on a change in pull request #26035:
[SPARK-29360][PYTHON][ML] PySpark FPGrowthModel supports getter/setter
URL: https://github.com/apache/spark/pull/26035#discussion_r331798830
##########
File path: python/pyspark/ml/fpm.py
##########
@@ -316,26 +399,39 @@ def findFrequentSequentialPatterns(self, dataset):
- `sequence: ArrayType(ArrayType(T))` (T is the item type)
- `freq: Long`
- >>> from pyspark.ml.fpm import PrefixSpan
- >>> from pyspark.sql import Row
- >>> df = sc.parallelize([Row(sequence=[[1, 2], [3]]),
- ... Row(sequence=[[1], [3, 2], [1, 2]]),
- ... Row(sequence=[[1, 2], [5]]),
- ... Row(sequence=[[6]])]).toDF()
- >>> prefixSpan = PrefixSpan(minSupport=0.5, maxPatternLength=5)
- >>>
prefixSpan.findFrequentSequentialPatterns(df).sort("sequence").show(truncate=False)
- +----------+----+
- |sequence |freq|
- +----------+----+
- |[[1]] |3 |
- |[[1], [3]]|2 |
- |[[1, 2]] |3 |
- |[[2]] |3 |
- |[[3]] |2 |
- +----------+----+
-
.. versionadded:: 2.4.0
"""
+
self._transfer_params_to_java()
jdf = self._java_obj.findFrequentSequentialPatterns(dataset._jdf)
return DataFrame(jdf, dataset.sql_ctx)
+
+
+if __name__ == "__main__":
Review comment:
It puzzles me too. Seems to me the doctests have never run before. I guess
nobody noticed this since no explicit error occurred.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]