AttributeError: 'list' object has no attribute 'create_png'
问题 This classifies the data as a decision tree. The decision tree is created but I am not able to view the decision tree. import numpy as np from sklearn import linear_model, datasets, tree import matplotlib.pyplot as plt iris = datasets.load_iris() f = open('decision_tree_data.txt') x_train = [] y_train = [] for line in f: line = np.asarray(line.split(),dtype = np.float32) x_train.append(line[:-1]) y_train.append(line[:-1]) x_train = np.asmatrix(x_train) y_train = np.asmatrix(y_train) model =