【发布时间】:2016-11-06 13:29:42
【问题描述】:
我在 Spark MLLib 中构建决策树
val dt = new DecisionTreeClassifier().setLabelCol("indexedLabel").setFeaturesCol("indexedFeatures").setImpurity(impurity).setMaxBins(maxBins).setMaxDepth(maxDepth)
我是这样显示的:
val treeModel = model.stages(1).asInstanceOf[DecisionTreeClassificationModel]
println("Learned classification tree model:\n" + treeModel.toDebugString)
结果是带有“特征 X”的树的文本描述,而不是我的数据集的实际特征名称,从而使树无法解释。
任何人都得到了指针来显示具有正确特征名称的树,从而使树的可解释性成为可能?谢谢!!
【问题讨论】:
标签: apache-spark machine-learning decision-tree