ctor, new shape and order. What does the line below do?
>
>
>
> Thank yuou,
>
>
>
>
>
> *From:* Artem [mailto:barmaley@gmail.com]
> *Sent:* Wednesday, February 11, 2015 1:39 PM
> *To:* scikit-learn-general@lists.sourceforge.net
> *Subject:* Re: [Scikit-
@gmail.com]
Sent: Wednesday, February 11, 2015 1:39 PM
To: scikit-learn-general@lists.sourceforge.net
Subject: Re: [Scikit-learn-general] regression with one independent variable
fit expects 2-dimensional input, whereas X[:, 0] is one dimensional. You can
either reshape it manually:
regr.fit
fit expects 2-dimensional input, whereas X[:, 0] is one dimensional. You
can either reshape it manually:
regr.fit(x_train[:, 0].reshape((x_train.shape[0], 1)), x_train[:, 1])
or use slices to select continuous range of columns:
regr.fit(x_train[:, :1], x_train[:, 1])
What exception tells you
I'm trying to make a linear regression with one independent variable and one or
more dependent variables.
That does not seem to work. Is that a limitation of regression function?
regr.fit(x_train[:, 0], x_train[:, 1])
File "/usr/local/lib/python2.7/dist-packages/sklearn/linear_model/base.py",