Author: Not specified Language: python
Description: (v11) Timestamp: 2018-05-21 03:23:53 +0000
View raw paste Parent paste by: Not specified Reply
  1. data_list = []
  2. resolution = 100
  3. colors=('b', 'k', 'r')
  4. fig, ax = plt.subplots()
  5. x_min, x_max = data_set[:, 0].min() - 1, data_set[:, 0].max() + 1
  6. y_min, y_max = data_set[:, 1].min() - 1, data_set[:, 1].max() + 1
  7. xx, yy = np.meshgrid(np.arange(x_min, x_max, plot_step),
  8.                      np.arange(y_min, y_max, plot_step))
  9.  
  10. Z = adaClassify(np.ndarray.tolist(np.c_[xx.ravel(), yy.ravel()]),classifierArray)
  11. Z = Z.reshape(xx.shape)
  12.  
  13. #ax.contour(xx, yy, Z, colors='k')
  14. cs = plt.contourf(xx, yy, Z, cmap=plt.cm.Paired)
  15. # Plot decision contours using grid and
  16. # make a scatter plot of training data
  17. #ax.contour(xrange, yrange, grid, colors='k')
  18. plt.scatter(sample_0_data_set[:,0], sample_0_data_set[:,1], s=15, c="blue")
  19. plt.scatter(sample_1_data_set[:,0], sample_1_data_set[:,1], s=15, c="red")
  20. #ax.scatter(data_set[:,0], data_set[:,1],c=data_set[:,2], cmap=plt.cm.viridis, lw=0, alpha=0.5)
  21. plt.title("Adabost Decision Boundary")
  22. plt.savefig("adabost_2949.png")
  23. plt.show()
View raw paste Parent paste by: Not specified Reply