我对下面的代码有疑问:
class Review(label: Double, features:org.apache.spark.ml.linalg.Vector)
def transformDataTFIDF(plainText: RDD[String],reviewClass:String,label:Int,numTerms:Int): org.apache.spark.sql.Dataset[Review] = {
val lemmatized = plainText.zipWithIndex.map(_.swap).mapPartitions(iter => {
val pipeline = createNLPPipeline();
iter.map{ case(id, contents) => (id.toString(),
plainTextToLemmas(contents, stopWords, pipeline))
};
}).cache()
val (termDocMatrix, termIds, docIds, idfs) = termDocumentMatrix(lemmatized, stopWords, numTerms, sc)
val vectorizedReviewsMap = Map( reviewClass -> termDocMatrix)
val ReviewsList = MutableList[Review]()
val ReviewsVecRDD = vectorizedReviewsMap(reviewClass).collect().foreach(v => ReviewsList += Review(label,v.asML))
ReviewsList.toDS()
}
我收到了这个错误:
<console>:73: error: not found: value MutableList
val ReviewsList = MutableList [Review]()
你能告诉我该怎么做才能纠正它吗?