Closed stephen-hoover closed 5 years ago
The glment.ElasticNet.predict method outputs an array with dimension 0 when given one row to predict. It should return an array with dimension 1 and shape (1,). Presumably the LogitNet.predict_proba has the same problem.
glment.ElasticNet.predict
LogitNet.predict_proba
Code to reproduce using glmnet v2.0.0:
from sklearn import datasets X, y = datasets.make_regression(n_samples=9, n_features=4, random_state=0) import glmnet print(glmnet.__version__) gl = glmnet.ElasticNet(random_state=0) gl.fit(X, y) print(gl.predict(X[:2], lamb=[20, 10]).shape) print(gl.predict(X[:1], lamb=[20, 10]).shape) print(gl.predict(X[:2]).shape) print(gl.predict(X[:1]).shape)
Actual output:
2.0.0+18.ga25bcef (2, 2) (2,) (2,) ()
Expected output:
2.0.0+18.ga25bcef (2, 2) (2,) (2,) (1,)
I'd originally reported this under #30 , but I believe it's a different issue.
The
glment.ElasticNet.predict
method outputs an array with dimension 0 when given one row to predict. It should return an array with dimension 1 and shape (1,). Presumably theLogitNet.predict_proba
has the same problem.Code to reproduce using glmnet v2.0.0:
Actual output:
Expected output:
I'd originally reported this under #30 , but I believe it's a different issue.