Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model_selection.LeaveOneLabelOut #6304

Closed
kingjr opened this issue Feb 7, 2016 · 7 comments
Closed

model_selection.LeaveOneLabelOut #6304

kingjr opened this issue Feb 7, 2016 · 7 comments

Comments

@kingjr
Copy link
Contributor

kingjr commented Feb 7, 2016

With 0.18.dev0, I get an init error from this:

from sklearn.model_selection import LeaveOneLabelOut
cv = LeaveOneLabelOut()  # ok
cv  # returns init error

here the bug report

Out[3]: ---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
/home/jrking/anaconda/lib/python2.7/site-packages/IPython/core/formatters.pyc in __call__(self, obj)
    695                 type_pprinters=self.type_printers,
    696                 deferred_pprinters=self.deferred_printers)
--> 697             printer.pretty(obj)
    698             printer.flush()
    699             return stream.getvalue()

/home/jrking/anaconda/lib/python2.7/site-packages/IPython/lib/pretty.pyc in pretty(self, obj)
    381                             if callable(meth):
    382                                 return meth(obj, self, cycle)
--> 383             return _default_pprint(obj, self, cycle)
    384         finally:
    385             self.end_group()

/home/jrking/anaconda/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _default_pprint(obj, p, cycle)
    501     if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
    502         # A user-provided repr. Find newlines and replace them with p.break_()
--> 503         _repr_pprint(obj, p, cycle)
    504         return
    505     p.begin_group(1, '<')

/home/jrking/anaconda/lib/python2.7/site-packages/IPython/lib/pretty.pyc in _repr_pprint(obj, p, cycle)
    683     """A pprint that just redirects to the normal repr function."""
    684     # Find newlines and replace them with p.break_()
--> 685     output = repr(obj)
    686     for idx,output_line in enumerate(output.splitlines()):
    687         if idx:

/home/jrking/.local/lib/python2.7/site-packages/sklearn/model_selection/_split.pyc in __repr__(self)
    109 
    110     def __repr__(self):
--> 111         return _build_repr(self)
    112 
    113 

/home/jrking/.local/lib/python2.7/site-packages/sklearn/model_selection/_split.pyc in _build_repr(self)
   1511     init = getattr(cls.__init__, 'deprecated_original', cls.__init__)
   1512     # Ignore varargs, kw and default values and pop self
-> 1513     init_signature = signature(init)
   1514     # Consider the constructor parameters excluding 'self'
   1515     if init is object.__init__:

/home/jrking/.local/lib/python2.7/site-packages/sklearn/externals/funcsigs.pyc in signature(obj)
    174         raise ValueError(msg)
    175 
--> 176     raise ValueError('callable {0!r} is not supported by signature'.format(obj))
    177 
    178 

ValueError: callable <slot wrapper '__init__' of 'object' objects> is not supported by signature
@agramfort
Copy link
Member

agramfort commented Feb 8, 2016 via email

@MechCoder
Copy link
Member

It works fine for me in Python3 in the master branch though

@amueller
Copy link
Member

amueller commented Feb 9, 2016

seems like an issue in repr

@amueller
Copy link
Member

amueller commented Feb 9, 2016

I bet that is the windows python3 failure @jakevdp found in #6274

@amueller
Copy link
Member

amueller commented Feb 9, 2016

wait, it's not on windows, or python3.... damn ^^

@raghavrv
Copy link
Member

ARghhh I'm getting this error too. Py2.7

Will push a fix ASAP

@raghavrv
Copy link
Member

I should have listened to Vlad/Andy and made a proper test for this :@

BTW figured out the problem. The BaseCrossValidator does not have an __init__ defined, which falls back to the python's c-defined default __init__. This default __init__ (for some implementation reason called as the slot-wrapper) is not supported by our external.funcsigs.signature.

Fix at #6328

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants