<p dir="auto">Perhaps it's using 32bit ints as the indices instead of u64?</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="from sklearn.ensemble import ExtraTreesClassifier
import numpy as np

np.random.seed(32)
clf = ExtraTreesClassifier(n_estimators=1000,
                           max_depth=None,
                           max_features=None,
                           min_samples_split=5,
                           min_samples_leaf=5)
print &quot;Making X&quot;
X = np.random.randn(25000,100000)
print &quot;X size&quot;, np.size(X)
print &quot;Making y&quot;
y = np.random.randint(10, size=(25000,1))
print &quot;Fitting...&quot;
clf.fit(X,y)"><pre class="notranslate"><span class="pl-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">ensemble</span> <span class="pl-k">import</span> <span class="pl-v">ExtraTreesClassifier</span>
<span class="pl-k">import</span> <span class="pl-s1">numpy</span> <span class="pl-k">as</span> <span class="pl-s1">np</span>

<span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">seed</span>(<span class="pl-c1">32</span>)
<span class="pl-s1">clf</span> <span class="pl-c1">=</span> <span class="pl-v">ExtraTreesClassifier</span>(<span class="pl-s1">n_estimators</span><span class="pl-c1">=</span><span class="pl-c1">1000</span>,
                           <span class="pl-s1">max_depth</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
                           <span class="pl-s1">max_features</span><span class="pl-c1">=</span><span class="pl-c1">None</span>,
                           <span class="pl-s1">min_samples_split</span><span class="pl-c1">=</span><span class="pl-c1">5</span>,
                           <span class="pl-s1">min_samples_leaf</span><span class="pl-c1">=</span><span class="pl-c1">5</span>)
<span class="pl-k">print</span> <span class="pl-s">"Making X"</span>
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randn</span>(<span class="pl-c1">25000</span>,<span class="pl-c1">100000</span>)
<span class="pl-k">print</span> <span class="pl-s">"X size"</span>, <span class="pl-s1">np</span>.<span class="pl-en">size</span>(<span class="pl-v">X</span>)
<span class="pl-k">print</span> <span class="pl-s">"Making y"</span>
<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-s1">random</span>.<span class="pl-en">randint</span>(<span class="pl-c1">10</span>, <span class="pl-s1">size</span><span class="pl-c1">=</span>(<span class="pl-c1">25000</span>,<span class="pl-c1">1</span>))
<span class="pl-k">print</span> <span class="pl-s">"Fitting..."</span>
<span class="pl-s1">clf</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>,<span class="pl-s1">y</span>)</pre></div>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[erg@pliny src]$ [master*] gdb python2
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type &quot;show copying&quot;
and &quot;show warranty&quot; for details.
This GDB was configured as &quot;x86_64-unknown-linux-gnu&quot;.
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;...
Reading symbols from /usr/bin/python2...(no debugging symbols found)...done.
(gdb) run crash.py 
Starting program: /usr/bin/python2 crash.py
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need &quot;set solib-search-path&quot; or &quot;set sysroot&quot;?
[Thread debugging using libthread_db enabled]
Using host libthread_db library &quot;/usr/lib/libthread_db.so.1&quot;.
Making X
X size 2500000000
Making y
Fitting...

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
(gdb) bt
#0  0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#1  0x00007fffe9680f2e in __pyx_f_7sklearn_4tree_5_tree_4Tree_recursive_partition ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#2  0x00007fffe9675008 in __pyx_f_7sklearn_4tree_5_tree_4Tree_build ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#3  0x00007fffe9671af0 in __pyx_pw_7sklearn_4tree_5_tree_4Tree_11build ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#4  0x00007ffff7afd192 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#5  0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#6  0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#7  0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#8  0x00007ffff7a8f63f in function_call () from /usr/lib/libpython2.7.so.1.0
#9  0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#10 0x00007ffff7af9cce in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#11 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#12 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#13 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7abe5b2 in slot_tp_init () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7abe24c in type_call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7afda83 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7abe962 in slot_tp_call () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#30 0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#31 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#32 0x00007ffff7afefb2 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#33 0x00007ffff7b17eea in run_mod () from /usr/lib/libpython2.7.so.1.0
#34 0x00007ffff7b18ce2 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#35 0x00007ffff7b196fb in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#36 0x00007ffff7b2a9f2 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#37 0x00007ffff747aa15 in __libc_start_main () from /usr/lib/libc.so.6
#38 0x0000000000400741 in _start ()"><pre class="notranslate"><code class="notranslate">[erg@pliny src]$ [master*] gdb python2
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later &lt;http://gnu.org/licenses/gpl.html&gt;
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
&lt;http://www.gnu.org/software/gdb/bugs/&gt;...
Reading symbols from /usr/bin/python2...(no debugging symbols found)...done.
(gdb) run crash.py 
Starting program: /usr/bin/python2 crash.py
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
Making X
X size 2500000000
Making y
Fitting...

Program received signal SIGSEGV, Segmentation fault.
0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
(gdb) bt
#0  0x00007fffe967d5f7 in __pyx_f_7sklearn_4tree_5_tree_4Tree_find_random_split ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#1  0x00007fffe9680f2e in __pyx_f_7sklearn_4tree_5_tree_4Tree_recursive_partition ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#2  0x00007fffe9675008 in __pyx_f_7sklearn_4tree_5_tree_4Tree_build ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#3  0x00007fffe9671af0 in __pyx_pw_7sklearn_4tree_5_tree_4Tree_11build ()
   from /usr/lib/python2.7/site-packages/sklearn/tree/_tree.so
#4  0x00007ffff7afd192 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#5  0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#6  0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#7  0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#8  0x00007ffff7a8f63f in function_call () from /usr/lib/libpython2.7.so.1.0
#9  0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#10 0x00007ffff7af9cce in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#11 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#12 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#13 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#14 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#15 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#16 0x00007ffff7abe5b2 in slot_tp_init () from /usr/lib/libpython2.7.so.1.0
#17 0x00007ffff7abe24c in type_call () from /usr/lib/libpython2.7.so.1.0
#18 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#19 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#20 0x00007ffff7afda83 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#21 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#22 0x00007ffff7a8f536 in function_call () from /usr/lib/libpython2.7.so.1.0
#23 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#24 0x00007ffff7a79e78 in instancemethod_call () from /usr/lib/libpython2.7.so.1.0
#25 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#26 0x00007ffff7abe962 in slot_tp_call () from /usr/lib/libpython2.7.so.1.0
#27 0x00007ffff7a6b8be in PyObject_Call () from /usr/lib/libpython2.7.so.1.0
#28 0x00007ffff7afab69 in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#29 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#30 0x00007ffff7afd15c in PyEval_EvalFrameEx () from /usr/lib/libpython2.7.so.1.0
#31 0x00007ffff7afeedd in PyEval_EvalCodeEx () from /usr/lib/libpython2.7.so.1.0
#32 0x00007ffff7afefb2 in PyEval_EvalCode () from /usr/lib/libpython2.7.so.1.0
#33 0x00007ffff7b17eea in run_mod () from /usr/lib/libpython2.7.so.1.0
#34 0x00007ffff7b18ce2 in PyRun_FileExFlags () from /usr/lib/libpython2.7.so.1.0
#35 0x00007ffff7b196fb in PyRun_SimpleFileExFlags () from /usr/lib/libpython2.7.so.1.0
#36 0x00007ffff7b2a9f2 in Py_Main () from /usr/lib/libpython2.7.so.1.0
#37 0x00007ffff747aa15 in __libc_start_main () from /usr/lib/libc.so.6
#38 0x0000000000400741 in _start ()
</code></pre></div>
<p dir="auto">I notice that the current <a href="http://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.SelectFromModel.html" rel="nofollow">SelectKBest</a> doesn't allow a user to select the <code class="notranslate">k</code> best features from a model. Are there any thoughts about adding a <code class="notranslate">k</code>-best feature selection using a model?</p>
<p dir="auto">Related: <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="149033549" data-permission-text="Title is private" data-url="https://github.com/scikit-learn/scikit-learn/issues/6673" data-hovercard-type="issue" data-hovercard-url="/scikit-learn/scikit-learn/issues/6673/hovercard" href="https://github.com/scikit-learn/scikit-learn/issues/6673">#6673</a>.</p>