$max
$max : integer
The maximum number of features to select, a runtime parameter.
A subclass of FeatureSelection that implements chi-squared feature selection.
This feature selection method scores each feature according to its informativeness, then selects the top N most informative features, where N is a run-time parameter.
buildMap(object $selected) : array
Constructs a map from old feature indices to new ones according to a max-heap of the most informative features. Always keep feature index 0, which is used as an intercept term.
object | $selected | max heap containing entries ordered by informativeness and feature index. |
associative array mapping a subset of the original feature indices to the new indices
select(object $features) : array
Uses the chi-squared feature selection algorithm to rank features by informativeness, and return a map from old feature indices to new ones.
.. instead of 22, 35, 75, ...).
object | $features | full feature set |
associative array mapping a subset of the original feature indices to new indices