Re: [Scikit-learn-general] Regarding classification with one variable only

2015-02-16 Thread shalu jhanwar
Thanks a lot Artem :) It worked! Shalu On Mon, Feb 16, 2015 at 2:05 PM, Artem wrote: > X needs to be a matrix of shape (n_samples, n_features), not a vector. You > need to reshape it into the matrix by doing > > X_train = X_train.reshape( (len(X_train), 1) ) > > On Mon, Feb 16, 2015 at 4:01 PM,

Re: [Scikit-learn-general] Regarding classification with one variable only

2015-02-16 Thread Artem
X needs to be a matrix of shape (n_samples, n_features), not a vector. You need to reshape it into the matrix by doing X_train = X_train.reshape( (len(X_train), 1) ) On Mon, Feb 16, 2015 at 4:01 PM, shalu jhanwar wrote: > Hi Scikit fans, > > I am facing following error while performing classifi

[Scikit-learn-general] Regarding classification with one variable only

2015-02-16 Thread shalu jhanwar
Hi Scikit fans, I am facing following error while performing classification with *single feature* only: reg = linear_model.LogisticRegression() *scores.append(reg.fit(X_train, y_train).score(X_test, y_test))* Traceback (most recent call last): File "", line 1, in File "/software/so/el6.3/Pyt