我正试图从我的原始数据中提取特征。
我的原始数据是 Seq[String] 是的。
Seq[String]
我想把这个变成 OneHot 使用多个 1 而不是只有一个,但似乎火花ml https://spark.apache.org/docs/latest/ml-features.html#onehotencoderestimator 只接受一个 String 作为输入。
OneHot
1
String
也许我是瞎子,但我似乎找不到一个接受字符串列表的。
谢谢您。
谢谢你@ user8371915
阅读 https://spark.apache.org/docs/2.2.0/ml-features.html#countvectorizer 似乎这正是我所需要的。
更多信息: How to get word details from TF Vector RDD in Spark ML Lib?