Skip to content

Broken example for multilabel classification example with cca #4643

Closed

Activity

  1. changed the title [-]Broken example for multilabel classification with cca[/-] [+]Broken example for multilabel classification example with cca[/+] on Apr 29, 2015
  2. ssaeger commented on Apr 29, 2015

    @ssaeger

    I had a look into the code and the problem seems to be the break in line 299 in pls_.py. (The line was added in 9c66a20)
    Unfortunately I'm not familiar enough with the algorithm to fix this, but it seems that the algorithm stops too early.
    Additionally, when I try the code for the plot with different values for random_state (e.g. 10), I can still reproduce the error:
    ValueError: array must not contain infs or NaNs

    I hope this helps somehow.

  3. amueller commented on Apr 29, 2015

    @amueller
    Member

    Interesting. I'm not sure how that could break the result.... @ssaeger so you get the ValueError on current dev, that is after 9c66a20?

  4. ssaeger commented on Apr 29, 2015

    @ssaeger

    Yes, I'm using the current dev version.
    I'm not sure if the break is really the problem here, but when I remove it, the plots are created and look good to me.
    For completeness here the part of my traceback:

    ...
    File "/home/.../scikit-learn/sklearn/cross_decomposition/pls_.py", line 40, in _nipals_twoblocks_inner_loop
        X_pinv = linalg.pinv(X)   # compute once pinv(X)
    File "/usr/lib/python2.7/dist-packages/scipy/linalg/basic.py", line 600, in pinv
        a = np.asarray_chkfinite(a)
    File "/usr/lib/python2.7/dist-packages/numpy/lib/function_base.py", line 595, in asarray_chkfinite
        "array must not contain infs or NaNs")
    ValueError: array must not contain infs or NaNs
    
  5. amueller commented on Apr 29, 2015

    @amueller
    Member

    I'll try to investigate (tomorrow?)

  6. amueller commented on Apr 30, 2015

    @amueller
    Member

    for the record, random_state=10 reproduces the value error.

  7. amueller commented on Apr 30, 2015

    @amueller
    Member

    I don't understand what is happening, and at this point I'm afraid to touch the code further without some significant reading on my part...

  8. amueller commented on Jun 11, 2015

    @amueller
    Member

    setting scale=False "fixes" the first plot. That was the buggy behavior prior to my "fix" (?). The second CCA plot looks the same though. Not sure if that means anything.

  9. mth4saurabh commented on Dec 1, 2015

    @mth4saurabh
    Contributor

    @amueller Interestingly I am getting different error when I change random_state to 10, last line of the traceback:

    AttributeError: '_ConstantPredictor' object has no attribute 'coef_'
  10. amueller commented on Dec 8, 2015

    @amueller
    Member

    @mth4saurabh that is a bit odd, but that just means your training set had only a single class. The error is in plot_hyperplane, right?

  11. mth4saurabh commented on Dec 9, 2015

    @mth4saurabh
    Contributor

    Yes the error is in plot_hyperplane. As for training single set having single class, n_classes is set to 2, but on increasing this number I no longer get any error.

  12. amueller commented on Dec 10, 2015

    @amueller
    Member

    the training set having a single class doesn't mean n_classes is set to zero. It means your random state was "unlucky" and you didn't get any samples of the negative class, I think.

  13. modified the milestone: 0.19 on Sep 29, 2016
  14. modified the milestones: 0.20, 0.19 on Jun 14, 2017
  15. amueller commented on Jul 16, 2018

    @amueller
    Member

    this was fixed long ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions