I was practicing using SGDRegressor in sklearn but I meet some problems, and I have simplified it as the following code.
import numpy as np
from sklearn.linear_model import SGDRegressor
X = np.array([0,0.5,1]).reshape((3,1))
y = np.array([0,0.5,1]).reshape((3,1))
sgd = SGDRegressor()
sgd.fit(X, y.ravel())
print("intercept=", sgd.intercept_)
print("coef=", sgd.coef_)
And this is the output:
intercept= [0.19835632]
coef= [0.18652387]
All the outputs are around intercept=0.19 and coef=0.18, but obviously the correct answer is intercept=0 and coef=1.
Even in this simple example, the program can't get the correct solution of the parameters. I wonder where I've made a mistake.

