import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.linear_model import SGDRegressor
#获取x轴的最大值和最小值
max_,min_ = feature.max()+1,feature.min()-1#线型图需要向量
x = np.linspace(min_,max_,100)
y = sgd.coef_ * x
plt.plot(feature,labels,lw=0,marker='o')
plt.plot(x,y)
#获取x轴的最大值和最小值
max_,min_ = feature.max()+1,feature.min()-1#线型图需要向量
x = np.linspace(min_,max_,100)
y = sgd_.coef_* x
plt.plot(feature,labels,lw=0,marker='o')
plt.plot(x,y)