sklearn.feature_selection.f_regression

sklearn.feature_selection.f_regression(X, y, center=True)[source]

Univariate linear regression tests.

Quick linear model for testing the effect of a single regressor, sequentially for many regressors.

This is done in 3 steps:

  1. The regressor of interest and the data are orthogonalized wrt constant regressors.
  2. The cross correlation between data and regressors is computed.
  3. It is converted to an F score then to a p-value.
Parameters:

X : {array-like, sparse matrix} shape = (n_samples, n_features)

The set of regressors that will tested sequentially.

y : array of shape(n_samples).

The data matrix

center : True, bool,

If true, X and y will be centered.

Returns:

F : array, shape=(n_features,)

F values of features.

pval : array, shape=(n_features,)

p-values of F-scores.

See also

f_classif
ANOVA F-value between labe/feature for classification tasks.
chi2
Chi-squared stats of non-negative features for classification tasks.