Python 如何显示此回归树?

Python 如何显示此回归树?,python,scikit-learn,jupyter-notebook,graphviz,Python,Scikit Learn,Jupyter Notebook,Graphviz,我已经在jupyter笔记本中编写了回归树的代码,但仅此代码无法显示输出。我会使用graphviz,但是所有使用graphviz的方法都需要QED,我的机器拒绝安装QED。有没有办法在没有graphviz或QED的情况下显示此树 import seaborn as sns from sklearn.model_selection import train_test_split from sklearn.tree import DecisionTreeRegressor from sklearn.

我已经在jupyter笔记本中编写了回归树的代码,但仅此代码无法显示输出。我会使用graphviz,但是所有使用graphviz的方法都需要QED,我的机器拒绝安装QED。有没有办法在没有graphviz或QED的情况下显示此树

import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
from sklearn.metrics import r2_score,mean_squared_error

x = maindf["Graduate Degree"].values.reshape(-1, 1)
y = maindf["Democrats 2016"].values.reshape(-1, 1)
x_train, x_test, y_train, y_test = train_test_split(x, y, test_size=0.30, random_state=42)

DecisionTreeRegModel = DecisionTreeRegressor(max_depth=3)
DecisionTreeRegModel.fit(x_train,y_train)
y_pred = DecisionTreeRegModel.predict(x_test) 
可以使用scikit学习可视化树

from sklearn import tree

_ = tree.plot_tree(DecisionTreeRegModel)