xmin, xmax = data[:,0].min(), data[:,0].max() ymin, ymax = data[:,1].min(), data[:,1].max() x = np.linspace(xmin,xmax, 1000) y = np.linspace(ymin, ymax, 1000) X,Y = np.meshgrid(x,y) X_test = np.c_[X.ravel(), Y.ravel()] y_logistic = logistic.predict(X_test) plt.pcolormesh(X,Y,y_logistic.reshape(1000,1000)) plt.scatter(data[:, 0], data[:,1], c=target, cmap=‘rainbow‘)
算法模型实现效果图
原文地址:https://www.cnblogs.com/gugubeng/p/9803439.html
时间: 2024-09-30 06:13:08