scikit-learn/scikit-learn — comment on commit 7ba791d16859aa68045913d0529add74a9eae71f
File: doc/modules/tree.rst line 206
By pprett:

we refer to ``a[mask]`` as fancy indexing (with a boolean mask).

If you look at the ``find_best_split`` function in the extension module ``_tree`` you notice that for each featuer the whole data array is scanned - but only those samples ``i`` are considered for which ``mask[i] == True``; otherwise the loop is continued. If ``mask`` gets too sparse (= its density approaches zero) the majority of the time ist spent checking the mask and continuing the loop. In this case it pays off to perform a (costly) fancy indexing ``X = X[mask]; mask = np.ones((X.shape[0],), dtype=np.bool)``.