diff --git a/scikits/learn/linear_model/logistic.py b/scikits/learn/linear_model/logistic.py index e136eb69f70..822549b1c62 100644 --- a/scikits/learn/linear_model/logistic.py +++ b/scikits/learn/linear_model/logistic.py @@ -163,7 +163,7 @@ class LogisticRegression(BaseLibLinear, ClassifierMixin, _y = np.empty(y.shape) _y[np.where(y == classes[0])] = -1 _y[np.where(y == classes[1])] = 1 - _y.shape = (1, np.size(y)) + _y = _y.reshape((1, -1)) den = np.max(np.abs(np.dot(_y, X))) if den == 0.0: diff --git a/scikits/learn/linear_model/sparse/logistic.py b/scikits/learn/linear_model/sparse/logistic.py index 3a46b6fd20c..3a6717b3a75 100644 --- a/scikits/learn/linear_model/sparse/logistic.py +++ b/scikits/learn/linear_model/sparse/logistic.py @@ -154,7 +154,7 @@ class LogisticRegression(SparseBaseLibLinear, ClassifierMixin, _y = np.empty(y.shape) _y[np.where(y == classes[0])] = -1 _y[np.where(y == classes[1])] = 1 - _y.shape = (1, np.size(y)) + _y = _y.reshape((1, -1)) den = np.max(np.abs(_y * X)) if den == 0.0: