A decision tree (regression) is a type of model that uses a combination of rules. The collection of rules is represented by a tree-shaped graph (tree structure), which is easy to interpret. This page runs a regression of a decision tree and further visualizes the resulting tree.
from sklearn.tree import DecisionTreeRegressor
from sklearn.datasets import make_regression
from dtreeviz.trees import *
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from dtreeviz.trees import dtreeviz
X, y = make_regression(n_samples=100, n_features=2, random_state=777)
plt.figure(figsize=(10, 10))
plt.scatter(X[:, 0], X[:, 1], c=y)
plt.show()
tree = DecisionTreeRegressor(max_depth=3, random_state=117117)
model = tree.fit(X, y)
viz = dtreeviz(tree, X, y, target_name="y")
viz.save("./regression_tree.svg")
from IPython.display import SVG
SVG(filename="regression_tree.svg")