Skip to main content

Module feature_scoring

Module feature_scoring 

Source
Expand description

Feature scoring functions for feature selection.

This module provides standalone univariate scoring functions that compute per-feature statistics and p-values:

  • f_classif โ€” ANOVA F-statistic for classification.
  • f_regression โ€” univariate F-statistic via Pearson correlation.
  • chi2 โ€” chi-squared statistic for non-negative features.

These functions return (F-statistics, p-values) tuples and can be used directly or passed to SelectKBest / SelectPercentile via the ScoreFunc enum.

Functionsยง

chi2
Compute chi-squared statistics between each non-negative feature and the class labels.
compute_scores_classif
Add FRegression and Chi2 variants to ScoreFunc.
compute_scores_regression
Compute regression scores, returning F-statistics only.
f_classif
Compute the ANOVA F-statistic and approximate p-values for each feature.
f_regression
Compute univariate F-statistics via Pearson correlation for regression.