Hello,
I'm quite new to scikit-learn, so please forgive me if I'm not doing it
right. I'm using version 0.14.
I'm using LassoCV and passing my own vector of alphas. What seems to be
happening is that somewhere inside the LinearModelCV.fit() function, the
alphas vector is copied and then sorted in a descending order. However,
when the optimal alpha index is found the alpha is then taken from the
original vector!!! Is this a bug or a feature?
Example:
X = [[1, 2], [-1, 2], [1, -2], [-2, 0], [0, -2]]
Y = [4, 5, 6, 7, 10]
regr = linear_model.LassoCV(alphas = [0.0001, 0.001], fit_intercept = False)
regr.fit(X, Y)
print "lasso r2", regr.score(X, Y), "alpha", regr.alpha_
regr = linear_model.LassoCV(alphas = [0.001, 0.0001], fit_intercept = False)
regr.fit(X, Y)
print "lasso r2", regr.score(X, Y), "alpha", regr.alpha_
outputs
lasso r2 -8.27498253267 alpha 0.0001
lasso r2 -8.27498282478 alpha 0.001
Thanks,
Alexey Sorokin.
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general