<p dir="auto">Test case. Fails for <code class="notranslate">score_func=f_classif</code> as well.</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="# Fixed already, I had an old .11-git release
import numpy as np
from sklearn.feature_selection import *
X = np.array([[-0.35407973, -0.73858161, -1.21871862,  0.01362241, -0.3565459 ],
       [-2.92151461, -0.64259241, -0.43849487,  1.01860028, -0.84427892],
       [-0.83171833, -0.0852727 , -1.89007728, -1.31564981,  0.1420426 ],
       [-0.62100712,  0.86350539, -0.49176233, -0.51831504,  1.98832398],
       [ 1.2643767 ,  0.33973403, -0.82126126, -0.08305002, -0.4985046 ]])

y = np.array([-0.17966557, -0.19387233,  1.77140599,  0.78315866, -1.40862817])

transformer = SelectKBest(score_func=chi2, k=3)
transformer.fit(X, y)
transformer.transform(X).shape[1]
assert transformer.transform(X).shape[1] == 3"><pre class="notranslate"><span class="pl-c"># Fixed already, I had an old .11-git release</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-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">feature_selection</span> <span class="pl-k">import</span> <span class="pl-c1">*</span>
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">-</span><span class="pl-c1">0.35407973</span>, <span class="pl-c1">-</span><span class="pl-c1">0.73858161</span>, <span class="pl-c1">-</span><span class="pl-c1">1.21871862</span>,  <span class="pl-c1">0.01362241</span>, <span class="pl-c1">-</span><span class="pl-c1">0.3565459</span> ],
       [<span class="pl-c1">-</span><span class="pl-c1">2.92151461</span>, <span class="pl-c1">-</span><span class="pl-c1">0.64259241</span>, <span class="pl-c1">-</span><span class="pl-c1">0.43849487</span>,  <span class="pl-c1">1.01860028</span>, <span class="pl-c1">-</span><span class="pl-c1">0.84427892</span>],
       [<span class="pl-c1">-</span><span class="pl-c1">0.83171833</span>, <span class="pl-c1">-</span><span class="pl-c1">0.0852727</span> , <span class="pl-c1">-</span><span class="pl-c1">1.89007728</span>, <span class="pl-c1">-</span><span class="pl-c1">1.31564981</span>,  <span class="pl-c1">0.1420426</span> ],
       [<span class="pl-c1">-</span><span class="pl-c1">0.62100712</span>,  <span class="pl-c1">0.86350539</span>, <span class="pl-c1">-</span><span class="pl-c1">0.49176233</span>, <span class="pl-c1">-</span><span class="pl-c1">0.51831504</span>,  <span class="pl-c1">1.98832398</span>],
       [ <span class="pl-c1">1.2643767</span> ,  <span class="pl-c1">0.33973403</span>, <span class="pl-c1">-</span><span class="pl-c1">0.82126126</span>, <span class="pl-c1">-</span><span class="pl-c1">0.08305002</span>, <span class="pl-c1">-</span><span class="pl-c1">0.4985046</span> ]])

<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">-</span><span class="pl-c1">0.17966557</span>, <span class="pl-c1">-</span><span class="pl-c1">0.19387233</span>,  <span class="pl-c1">1.77140599</span>,  <span class="pl-c1">0.78315866</span>, <span class="pl-c1">-</span><span class="pl-c1">1.40862817</span>])

<span class="pl-s1">transformer</span> <span class="pl-c1">=</span> <span class="pl-v">SelectKBest</span>(<span class="pl-s1">score_func</span><span class="pl-c1">=</span><span class="pl-s1">chi2</span>, <span class="pl-s1">k</span><span class="pl-c1">=</span><span class="pl-c1">3</span>)
<span class="pl-s1">transformer</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>)
<span class="pl-s1">transformer</span>.<span class="pl-en">transform</span>(<span class="pl-v">X</span>).<span class="pl-s1">shape</span>[<span class="pl-c1">1</span>]
<span class="pl-k">assert</span> <span class="pl-s1">transformer</span>.<span class="pl-en">transform</span>(<span class="pl-v">X</span>).<span class="pl-s1">shape</span>[<span class="pl-c1">1</span>] <span class="pl-c1">==</span> <span class="pl-c1">3</span></pre></div>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import numpy as np
from sklearn.feature_selection import *
X = np.array([[-0.35407973, -0.73858161, -1.21871862,  0.01362241, -0.3565459 ],
       [-2.92151461, -0.64259241, -0.43849487,  1.01860028, -0.84427892],
       [-0.83171833, -0.0852727 , -1.89007728, -1.31564981,  0.1420426 ],
       [-0.62100712,  0.86350539, -0.49176233, -0.51831504,  1.98832398],
       [ 1.2643767 ,  0.33973403, -0.82126126, -0.08305002, -0.4985046 ]])

y = np.array([-0.17966557, -0.19387233,  1.77140599,  0.78315866, -1.40862817])

transformer = SelectPercentile(score_func=chi2, percentile=60)
transformer.fit(X, y)
transformer.transform(X).shape[1]
assert transformer.transform(X).shape[1] == 3"><pre class="notranslate"><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-k">from</span> <span class="pl-s1">sklearn</span>.<span class="pl-s1">feature_selection</span> <span class="pl-k">import</span> <span class="pl-c1">*</span>
<span class="pl-v">X</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([[<span class="pl-c1">-</span><span class="pl-c1">0.35407973</span>, <span class="pl-c1">-</span><span class="pl-c1">0.73858161</span>, <span class="pl-c1">-</span><span class="pl-c1">1.21871862</span>,  <span class="pl-c1">0.01362241</span>, <span class="pl-c1">-</span><span class="pl-c1">0.3565459</span> ],
       [<span class="pl-c1">-</span><span class="pl-c1">2.92151461</span>, <span class="pl-c1">-</span><span class="pl-c1">0.64259241</span>, <span class="pl-c1">-</span><span class="pl-c1">0.43849487</span>,  <span class="pl-c1">1.01860028</span>, <span class="pl-c1">-</span><span class="pl-c1">0.84427892</span>],
       [<span class="pl-c1">-</span><span class="pl-c1">0.83171833</span>, <span class="pl-c1">-</span><span class="pl-c1">0.0852727</span> , <span class="pl-c1">-</span><span class="pl-c1">1.89007728</span>, <span class="pl-c1">-</span><span class="pl-c1">1.31564981</span>,  <span class="pl-c1">0.1420426</span> ],
       [<span class="pl-c1">-</span><span class="pl-c1">0.62100712</span>,  <span class="pl-c1">0.86350539</span>, <span class="pl-c1">-</span><span class="pl-c1">0.49176233</span>, <span class="pl-c1">-</span><span class="pl-c1">0.51831504</span>,  <span class="pl-c1">1.98832398</span>],
       [ <span class="pl-c1">1.2643767</span> ,  <span class="pl-c1">0.33973403</span>, <span class="pl-c1">-</span><span class="pl-c1">0.82126126</span>, <span class="pl-c1">-</span><span class="pl-c1">0.08305002</span>, <span class="pl-c1">-</span><span class="pl-c1">0.4985046</span> ]])

<span class="pl-s1">y</span> <span class="pl-c1">=</span> <span class="pl-s1">np</span>.<span class="pl-en">array</span>([<span class="pl-c1">-</span><span class="pl-c1">0.17966557</span>, <span class="pl-c1">-</span><span class="pl-c1">0.19387233</span>,  <span class="pl-c1">1.77140599</span>,  <span class="pl-c1">0.78315866</span>, <span class="pl-c1">-</span><span class="pl-c1">1.40862817</span>])

<span class="pl-s1">transformer</span> <span class="pl-c1">=</span> <span class="pl-v">SelectPercentile</span>(<span class="pl-s1">score_func</span><span class="pl-c1">=</span><span class="pl-s1">chi2</span>, <span class="pl-s1">percentile</span><span class="pl-c1">=</span><span class="pl-c1">60</span>)
<span class="pl-s1">transformer</span>.<span class="pl-en">fit</span>(<span class="pl-v">X</span>, <span class="pl-s1">y</span>)
<span class="pl-s1">transformer</span>.<span class="pl-en">transform</span>(<span class="pl-v">X</span>).<span class="pl-s1">shape</span>[<span class="pl-c1">1</span>]
<span class="pl-k">assert</span> <span class="pl-s1">transformer</span>.<span class="pl-en">transform</span>(<span class="pl-v">X</span>).<span class="pl-s1">shape</span>[<span class="pl-c1">1</span>] <span class="pl-c1">==</span> <span class="pl-c1">3</span></pre></div>
<p dir="auto">error: Command "aarch64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include -I/home/nvidia/.local/lib/python3.5/site-packages/numpy/core/include -I/usr/include/python3.5m -c sklearn/neighbors/quad_tree.c -o build/temp.linux-aarch64-3.5/sklearn/neighbors/quad_tree.o -MMD -MF build/temp.linux-aarch64-3.5/sklearn/neighbors/quad_tree.o.d" failed with exit status 1</p>