You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In [11]: glm.LARS(fit_intercept=True)
TypeError: init() got an unexpected keyword argument 'fit_intercept'
In [10]: glm.LARS(normalize=True)
TypeError: init() takes at least 2 non-keyword arguments (1 given)
and then for prediction:
In [18]: clf.fit(sc.transform(x_train),sc_y.transform(y_train))
Out[18]: LARS(normalize=True, n_features=2)
In [19]: clf.predict(sc.transform(x_test))
/software/pythonenvs/devpype/lib/python2.6/site-packages/scikits/learn/glm/base.pyc in predict(self, X)
40 """
41 X = np.asanyarray(X)
---> 42 return np.dot(X, self.coef_) + self.intercept_
43
44 def _explained_variance(self, X, Y):
AttributeError: 'LARS' object has no attribute 'intercept_'
Activity
agramfort commentedon Oct 24, 2010
I'm confused. Can you provide the lines that lead to the crash?
satra commentedon Oct 24, 2010
first check docstring: glm.LARS?
In [11]: glm.LARS(fit_intercept=True)
TypeError: init() got an unexpected keyword argument 'fit_intercept'
In [10]: glm.LARS(normalize=True)
TypeError: init() takes at least 2 non-keyword arguments (1 given)
and then for prediction:
In [18]: clf.fit(sc.transform(x_train),sc_y.transform(y_train))
Out[18]: LARS(normalize=True, n_features=2)
In [19]: clf.predict(sc.transform(x_test))
/software/pythonenvs/devpype/lib/python2.6/site-packages/scikits/learn/glm/base.pyc in predict(self, X)
40 """
41 X = np.asanyarray(X)
---> 42 return np.dot(X, self.coef_) + self.intercept_
43
44 def _explained_variance(self, X, Y):
AttributeError: 'LARS' object has no attribute 'intercept_'
fabianp commentedon Oct 25, 2010
Thanks Satra for the bug report. It seems we did a lot of API changes to LassoLARS and forgot to re-apply them on LARS.
Assigning this to me
agramfort commentedon Nov 2, 2010
should be fixed in :
http://github.com/scikit-learn/scikit-learn/commit/7a2b8031c976f5026a8db353f9fb44adcd6b5b34
fabianp commentedon Nov 25, 2010
Closing this one
Merge pull request #8 from GaelVaroquaux/dwf_sparse_pca
Merge pull request #8 from larsmans/news20_loader
Merge pull request #8 from glouppe/treeweights
Merge pull request scikit-learn#9 from benjaminwilson/master
Merge pull request #8 from glouppe/gbm
Merge pull request #8 from janvanrijn/encode
Merge pull request #8 from scikit-learn/master
Merge pull request scikit-learn#8 from prismdata/master
Merge pull request scikit-learn#8 from arka204/alpha-close-or-equal-0…
Merge pull request #8 from ogrisel/kneighbors-input-validation