图形绘制
from matplotlib.colors import ListedColormap cmap = ListedColormap(['#00aaff','#ff00aa','#aaff00']) titles = ['DecisonTree','Knn','Logistic'] plt.figure(figsize=(12,3)) for i,y_ in enumerate(results): axes = plt.subplot(1,3,i+1) axes.scatter(X_test[:,0],X_test[:,1],c=y_,cmap=cmap) axes.set_title(titles[i]) axes.scatter(train[:,0],train[:,1],c=target)机器学习之决策树(四) (6)
内容版权声明:除非注明,否则皆为本站原创文章。