Skip to content

LARS module broken #8

Closed
Closed

Description

@satra
  • the parameter names are different in docstring
  • error below

/software/python/nipype0.3/lib/python2.6/site-packages/scikits.learn-0.6_git-py2.6-linux-x86_64.egg/scikits/learn/glm/base.pyc in predict(self, X)
40 """
41 X = np.asanyarray(X)
---> 42 return np.dot(X, self.coef_) + self.intercept_

Activity

  1. agramfort commented on Oct 24, 2010

    @agramfort
    Member

    I'm confused. Can you provide the lines that lead to the crash?

  2. satra commented on Oct 24, 2010

    @satra
    MemberAuthor

    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_'

  3. fabianp commented on Oct 25, 2010

    @fabianp
    Member

    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

  4. fabianp commented on Nov 25, 2010

    @fabianp
    Member

    Closing this one

  5. added a commit that references this issue on Jul 16, 2011
  6. added a commit that references this issue on Dec 20, 2011
  7. added a commit that references this issue on Dec 18, 2012
  8. added a commit that references this issue on May 20, 2013
    f5a47bd
  9. added a commit that references this issue on Jan 8, 2014
  10. added a commit that references this issue on Aug 6, 2018
  11. added a commit that references this issue on Jun 20, 2019
  12. added a commit that references this issue on Oct 28, 2020
  13. added a commit that references this issue on Nov 10, 2020
  14. added a commit that references this issue on Jan 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions