Re: [Scikit-learn-general] Error when using an array for one feature linear regression

2013-10-18 Thread Andreas Mueller
On 09/24/2013 05:30 AM, Luca Cerone wrote: > Thanks Vlad, and Jacques, > I agree that it is explained in the documentation, and probably cover > such cases would be cumbersome. > > I am a long-time matlab user, that's why sometimes I wonder if certain > features are intended or not. > > Thanks fo

Re: [Scikit-learn-general] Error when using an array for one feature linear regression

2013-09-24 Thread Luca Cerone
Thanks Vlad, and Jacques, I agree that it is explained in the documentation, and probably cover such cases would be cumbersome. I am a long-time matlab user, that's why sometimes I wonder if certain features are intended or not. Thanks for the time, and for the trick on reshaping the vector! On

Re: [Scikit-learn-general] Error when using an array for one feature linear regression

2013-09-24 Thread Vlad Niculae
Just to add, I don't think you need to reshape y. And reshaping x can be more briefly stated as x[:, np.newaxis]. In my opinion supporting such cases, while convenient for users, would lead to annyoing branches and code that is harder to maintain and test. The important thing is being consistent.

Re: [Scikit-learn-general] Error when using an array for one feature linear regression

2013-09-24 Thread Jaques Grobler
On a sidenote regarding my different traceback - i'm using the latest developers version 2013/9/24 Jaques Grobler > Hi Luca, > > From the docs, > > fit(*X*, *y*, > *n_jobs=1*)

Re: [Scikit-learn-general] Error when using an array for one feature linear regression

2013-09-24 Thread Jaques Grobler
Hi Luca, >From the docs, fit(*X*, *y*, *n_jobs=1*) Fit linear model. Parameters : *X* : numpy array or sparse matrix of shape [n_samples,n_features] Training

[Scikit-learn-general] Error when using an array for one feature linear regression

2013-09-24 Thread Luca Cerone
Dear all, I have noticed that the Linear Regression fails to perform the prediction if performed on with a dataset and target that are normal array. You can replicate this as follows: from pylab import linspace, permutation, randn from sklearn import linear_model >>> clf = linear_model.LinearRe