from sklearn.tree import DecisionTreeClassifier
import tensorflow as tf
from sklearn import metrics

# 导入MNIST数据集
(X_T, Y_T), (X_TE, Y_TE) = tf.keras.datasets.mnist.load_data()

# 实例化决策树分类器
clf = DecisionTreeClassifier()

# 准备数据
X_T = X_T.reshape((60000, 784))
X_TE = X_TE.reshape((10000, 784))

# 训练决策树
clf.fit(X_T, Y_T)

# 测试模型
y_pred = clf.predict(X_TE)
print("Accuracy of the Decision Trees is :", metrics.accuracy_score(Y_TE, y_pred) * 100)
c264157ac98442219cc4927e2c77973943c9f38c
<mask token>

<mask token>
clf.fit(X_T, Y_T)
<mask token>
print('Accuracy of the Decision Trees is :', metrics.accuracy_score(Y_TE,
    y_pred) * 100)

<mask token>
(X_T, Y_T), (X_TE, Y_TE) = tf.keras.datasets.mnist.load_data()
clf = DecisionTreeClassifier()
X_T = X_T.reshape((60000, 784))
X_TE = X_TE.reshape((10000, 784))
clf.fit(X_T, Y_T)
y_pred = clf.predict(X_TE)
print('Accuracy of the Decision Trees is :', metrics.accuracy_score(Y_TE,
    y_pred) * 100)

from sklearn.tree import DecisionTreeClassifier
import tensorflow as tf
from sklearn import metrics
(X_T, Y_T), (X_TE, Y_TE) = tf.keras.datasets.mnist.load_data()
clf = DecisionTreeClassifier()
X_T = X_T.reshape((60000, 784))
X_TE = X_TE.reshape((10000, 784))
clf.fit(X_T, Y_T)
y_pred = clf.predict(X_TE)
print('Accuracy of the Decision Trees is :', metrics.accuracy_score(Y_TE,
    y_pred) * 100)

from sklearn.tree import DecisionTreeClassifier
import tensorflow as tf
from sklearn import metrics

# 导入MNIST数据集
(X_T, Y_T), (X_TE, Y_TE) = tf.keras.datasets.mnist.load_data()

# 实例化决策树分类器
clf = DecisionTreeClassifier()

# 准备数据
X_T = X_T.reshape((60000, 784))
X_TE = X_TE.reshape((10000, 784))

# 训练决策树
clf.fit(X_T, Y_T)

# 测试模型
y_pred = clf.predict(X_TE)
print("Accuracy of the Decision Trees is :", metrics.accuracy_score(Y_TE, y_pred) * 100)