Cli*_*der 8 scala random-forest apache-spark apache-spark-mllib
该文件为随机森林不包括功能重要性有关.但是,它在Jira上列为已解决并且在源代码中.HERE还说"这个API和原始MLlib合奏API之间的主要区别是:
但是,我无法找出可以调用此新功能的语法.
scala> model
res13: org.apache.spark.mllib.tree.model.RandomForestModel =
TreeEnsembleModel classifier with 10 trees
scala> model.featureImportances
<console>:60: error: value featureImportances is not a member of org.apache.spark.mllib.tree.model.RandomForestModel
model.featureImportances
Run Code Online (Sandbox Code Playgroud)
您必须使用新的随机森林。检查您的进口。老人:
import org.apache.spark.mllib.tree.RandomForest
import org.apache.spark.mllib.tree.model.RandomForestModel
Run Code Online (Sandbox Code Playgroud)
新的随机森林使用:
import org.apache.spark.ml.classification.RandomForestClassificationModel
import org.apache.spark.ml.classification.RandomForestClassifier
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6835 次 |
| 最近记录: |