\seekquarry\yioop\library\classifiersChiSquaredFeatureSelection

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.

Summary

Methods
Properties
Constants
__construct()
buildMap()
select()
$max
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$max

$max : integer

The maximum number of features to select, a runtime parameter.

Type

integer

Methods

__construct()

__construct(array  $parameters = array()) 

Sets any passed runtime parameters.

Parameters

array $parameters

optional associative array of parameters to replace the default ones with

buildMap()

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.

Parameters

object $selected

max heap containing entries ordered by informativeness and feature index.

Returns

array —

associative array mapping a subset of the original feature indices to the new indices

select()

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, ...).

Parameters

object $features

full feature set

Returns

array —

associative array mapping a subset of the original feature indices to new indices