python - How to fit SGDRegressor with two numpy arrays? -
i'm trying learn sgdregressor
. generate own data don't know how fit algorithm. error.
x = np.random.randint(100, size=1000) y = x * 0.10 clf = linear_model.sgdregressor() clf.fit(x, y, coef_init=0, intercept_init=0)
found arrays inconsistent numbers of samples: [ 1 1000]
i'm new python , machine learning. miss?
>>> np.random.randint(100, size=1000)
will give 1 x 1000 array. features , target variables need in column. try
>>> x = x.reshape(1000,)
Comments
Post a Comment