Expand description
Univariate feature selection: variance-threshold filtering and the ANOVA
F-test (f_classif) univariate score.
Both selectors operate on a feature matrix x given as one inner Vec<f64>
per sample (row), with x[i][j] the value of feature j for sample i;
every row must share the same feature count. They return a per-feature result
plus a boolean selection mask so a caller can threshold, rank, or inspect the
scores directly. The numerics pin the reference-library conventions the
equivalence suite checks:
- variance threshold drops features whose population variance
(
ddof = 0) is≤ threshold, keepingvariance > threshold, matchingsklearn.feature_selection.VarianceThreshold; - the ANOVA F-test computes, per feature, the one-way ANOVA F-statistic
across the labelled classes and its upper-tail p-value, reproducing
sklearn.feature_selection.f_classif(which is itself a per-feature one-way ANOVA). The selection keeps the top-kfeatures by F-score.
This base block backs the FeatureSelection computational method.
Structs§
- Selection
- The result of running a univariate selector over a feature matrix: the per-feature scores and the boolean selection mask, aligned to column order.
Enums§
- Feature
Selection Error - Errors that prevent a selector from scoring a feature matrix.
Functions§
- anova_
f_ pvalues - Computes the per-feature ANOVA F-test p-values (
f_classif), in column order. - anova_
f_ scores - Computes the per-feature ANOVA F-statistics (
f_classif), in column order. - anova_
f_ select - Scores each feature by the ANOVA F-test across the labelled classes
(
f_classif), keeping the top-kby F-score. - variance_
threshold - Selects features whose population variance exceeds
threshold.