我有sample.txt:
1 2 3
1 3 2 1 2
1 2 5
6
我需要将此转换为Feed作为prefixSpan
mllib
Spark
的输入,
http://spark.apache.org/docs/latest/mllib-frequent-pattern-mining.html
我用过
val data = sc.textFile("...")
data.map(_.split(' ').map(s => Array(s.toInt)))
但是当我运行
时,我遇到了以下错误<console>:36: error: inferred type arguments [Nothing,Nothing,org.apache.spark.rdd.RDD[Array[Array[String]]]] do not conform to method run's type parameter bounds [Item,Itemset <: Iterable[Item],Sequence <: Iterable[Itemset]]
val model = prefixSpan.run(sequences)