__construct()
__construct(array $parameters = array())
Sets any passed runtime parameters.
Parameters
array | $parameters | optional associative array of parameters to replace the default ones with |
This is an abstract class that specifies an interface for selecting top features from a dataset.
Each FeatureSelection class implements a select method that takes a Features instance and returns a mapping from a subset of the old feature indices to new ones.
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
Computes the top features of a Features instance, and returns a mapping from a subset of those features to new contiguous indices. The mapping allows documents that have already been mapped into the larger feature space to be converted to the smaller feature space, while keeping the feature indices contiguous (e.g., 1, 2, 3, 4, .
.. instead of 22, 35, 75, ...).
object | $features | Features instance |
associative array mapping a subset of the original feature indices to new indices