import pickle # dump:将python对象序列化保存至本地文件 pickle.dump(model_kmeans,open('my_model_object.pk1','wb')) #load:从本地文件读取python对象并恢复实例对象 model_kmeans = pickle.load(open('my_model_object.pk1','rb')) 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 5.模型...
plt.scatter(X[outlier_mask], y[outlier_mask], c='lightgreen', marker='s', label='Outliers') plt.plot(line_X, line_y_ransac, color='red') #构造出的预测点做的回归线 plt.plot(X[inlier_mask],ransac.predict(X[inlier_mask]),color='m') #用于建模的inliers点做的回归线 plt.xlabel('A...