I have data in a key,value pairing the key is the column index and the value is whatever is in that columns value. My original file is just a csv. So I have the following:
val myData = sc.textFile(file1)
.map(x => x.split('|'))
.flatMap(x => x.zipWithIndex)
.map(x => x.swap)
.groupByKey().cache
This puts my data into myData: Array[(Int, Iterable[String])]
val fpg = new FPGrowth()
.setMinSupport(0.2)
.setNumPartitions(1)
val model = fpg.run(myData)
I get the following issues:
<console>:29: error: inferred type arguments [Nothing,(Int, Iterable[String])] do not conform to method run's type parameter bounds [Item,Basket <: Iterable[Item]]
I am trying to learn how to use MlLib, and don't quite understand the issue. I've also tried removing the index and .map(x=>x._2) and making sets of just the iterable data but that also fails.