<p dir="auto">sklearn 0.18.1<br>
numpy 1.12.0rc1,<br>
scipy 0.18.1<br>
sklearn 0.18.1<br>
python 3.5.2</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="from sklearn.metrics import confusion_matrix"><pre class="notranslate"><code class="notranslate">from sklearn.metrics import confusion_matrix
</code></pre></div>
<p dir="auto">File "lib\sklearn_<em>init</em>_.py", line 57, in <br>
from .base import clone<br>
File "lib\sklearn\base.py", line 12, in <br>
from .utils.fixes import signature<br>
File "lib\sklearn\utils_<em>init</em>_.py", line 11, in <br>
from .validation import (as_float_array,<br>
File "lib\sklearn\utils\validation.py", line 18, in <br>
from ..utils.fixes import signature<br>
File "lib\sklearn\utils\fixes.py", line 406, in <br>
if np_version &lt; (1, 12, 0):<br>
TypeError: unorderable types: str() &lt; int()</p>
<p dir="auto">File: sklearn\utils\fixes.py, line 406 if the 'if' statement</p>
<p dir="auto">if np_version &lt; (1, 12, 0):<br>
class MaskedArray(np.ma.MaskedArray):<br>
# Before numpy 1.12, np.ma.MaskedArray object is not picklable<br>
# This fix is needed to make our model_selection.GridSearchCV</p>
<p dir="auto">There is a new bug in master brunch, <code class="notranslate">scikit-learn/sklearn/utils/fixes.py</code><br>
in line 406: <code class="notranslate">if np_version &lt; (1, 12, 0):</code> , an error occured, <code class="notranslate">TypeError: unorderable types: str() &lt; int()</code>.<br>
It's because in the function :</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="def _parse_version(version_string):
    version = []
    for x in version_string.split('.'):
        try:
            version.append(int(x))
        except ValueError:
            # x may be of the form dev-1ea1592
            version.append(x)
    return tuple(version)"><pre class="notranslate"><code class="notranslate">def _parse_version(version_string):
    version = []
    for x in version_string.split('.'):
        try:
            version.append(int(x))
        except ValueError:
            # x may be of the form dev-1ea1592
            version.append(x)
    return tuple(version)
</code></pre></div>
<p dir="auto">However， my numpy version is：<code class="notranslate">1.12.0b1</code>, this funciotn return a tuple(1,12,'0b1') , but in line 406, It is compared with integer type, so the error occured.<br>
I just in a simple way to solve it. I change the code to <code class="notranslate">if np_version &lt; (1, 12, '0'):</code> in line 406, just change the third tuple index to string type.<br>
Of course, this is not a common method.</p>