The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

309069 (11) [Avatar] Offline
[ 5 KB ]
I get the following error when trying to perform "predictions" (see also attached file):

scala> val predictions = model.transform(testingData)
java.lang.ClassCastException:$ cannot be cast to
at scala.collection.IndexedSeqOptimized$class.foldl(IndexedSeqOptimized.scala:57)
at scala.collection.IndexedSeqOptimized$class.foldLeft(IndexedSeqOptimized.scala:66)
at scala.collection.mutable.ArrayOps$ofRef.foldLeft(ArrayOps.scala:186)
... 48 elided

Note (nothing to do with the error): I had to comment .setLabels(labelIndexer.labels) since "labels" is not sopprted in StringIndexer
Jeff Smith (14) [Avatar] Offline
From the data that you've provided me, it's not entirely clear what the problem is. Looks like you just need to satisfy Spark that the column is of the type that it needs to be. Have you investigated the example code in the GitHub repo for possible differences between it and what you tried?