pyspark.mllib.fpm.
PrefixSpanModel
Model fitted by PrefixSpan
New in version 1.6.0.
Examples
>>> data = [ ... [["a", "b"], ["c"]], ... [["a"], ["c", "b"], ["a", "b"]], ... [["a", "b"], ["e"]], ... [["f"]]] >>> rdd = sc.parallelize(data, 2) >>> model = PrefixSpan.train(rdd) >>> sorted(model.freqSequences().collect()) [FreqSequence(sequence=[['a']], freq=3), FreqSequence(sequence=[['a'], ['a']], freq=1), ...
Methods
call(name, *a)
call
Call method of java_model
freqSequences()
freqSequences
Gets frequent sequences
Methods Documentation