The method run(JavaRDD<Sequence>) is not applicable for the arguments (JavaRDD<List<String>>)
<p>When trying to execute the Prefixspan algo in the spark mllib I get the error </p>

<blockquote>
  <p>The method run(JavaRDD Sequence ) in the type PrefixSpan is not applicable >for the arguments (JavaRDD List String)</p>
</blockquote>

<p>The code I see on the website is</p>

<pre><code>JavaRDD&lt;List&lt;List&lt;Integer&gt;&gt;&gt; sequences = sc.parallelize(Arrays.asList(
Arrays.asList(Arrays.asList(1, 2), Arrays.asList(3)),
Arrays.asList(Arrays.asList(1), Arrays.asList(3, 2), Arrays.asList(1, 2)),
Arrays.asList(Arrays.asList(1, 2), Arrays.asList(5)),
Arrays.asList(Arrays.asList(6))), 2);
PrefixSpan prefixSpan = new PrefixSpan().setMinSupport(0.5).setMaxPatternLength(5);
PrefixSpanModel&lt;Integer&gt; model = prefixSpan.run(sequences);
for (PrefixSpan.FreqSequence&lt;Integer&gt; freqSeq: model.freqSequences().toJavaRDD().collect()) {
     System.out.println(freqSeq.javaSequence() + ", " + freqSeq.freq());
}
</code></pre>

<p>My code is</p>

<pre><code>List&lt;List&lt;String&gt;&gt; sequences = createLists(featuresForAlgo);

JavaRDD&lt;List&lt;String&gt;&gt; rdd =  sc.parallelize(sequences);

PrefixSpan prefixSpan = new PrefixSpan()
          .setMinSupport(0.5)
          .setMaxPatternLength(5);
        PrefixSpanModel&lt;String&gt; model = prefixSpan.run(rdd);
        for (PrefixSpan.FreqSequence&lt;Integer&gt; freqSeq: model.freqSequences().toJavaRDD().collect()) {
          System.out.println(freqSeq.javaSequence() + ", " + freqSeq.freq());
        }
</code></pre>

<p>Where the method prefixSpan.run(rdd) gives the error.
Any idea why I get this error?
As far as I know a List is a sequence.</p>

<p>Thanks</p>