Thanks to visit codestin.com
Credit goes to github.com

Skip to content

linear_model.SGDRegressor : Buffer has wrong number of dimensions (expected 1, got 2) #604

@vicpara

Description

@vicpara

Hello,
I'm using SGDRegressor to fit a data set of 74K entries and 11 features.When I call the fit method I get the error from below. I've tried to understand the problem but I cannot say what shall I do differently. The entries from y are equal with the entries in X.

The error:
Traceback (most recent call last):
File "D:\Work\Python\HeritagePrize\HeritagePrize\Program.py", line 45, in
error = sgd.Train()
File "D:\Work\Python\HeritagePrize\HeritagePrize\MyPredictors.py", line 103, in Train
self.predictor.fit(data.trainData, data.trainTarget)
File "C:\Python27\lib\site-packages\sklearn\linear_model\base.py", line 506, in fit
self._fit_regressor(X, y)
File "C:\Python27\lib\site-packages\sklearn\linear_model\stochastic_gradient.py", line 330, in _fit_regressor
self.eta0, self.power_t)
File "sgd_fast.pyx", line 214, in sklearn.linear_model.sgd_fast.plain_sgd (sklearn\linear_model\sgd_fast.c:4954)
ValueError: Buffer has wrong number of dimensions (expected 1, got 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions