由于graphviz包需要配置环境比较麻烦,因此使用sklearn 0.21版本更新的plot_tree方法来可视化决策树。
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
cn=['0','1']
# Setting dpi =
由于graphviz包需要配置环境比较麻烦,因此使用sklearn 0.21版本更新的plot_tree方法来可视化决策树。
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.tree import DecisionTreeClassifier
from sklearn import tree
cn=['0','1']
# Setting dpi =