实例
from sklearn.datasets import load_iris
from sklearn import tree
import matplotlib.pyplot as plt# Load iris dataset
iris load_iris()
X, y iris.data, iris.target# Fit the classifier
clf tree.DecisionTreeClassifier()
clf clf.fit(X, y)# Plot the deci…