It is converted to an F score and then to a p-value.
f_regression is derived from r_regression and will rank
features in the same order if all the features are positively correlated
with the target.
Note however that contrary to f_regression, r_regression
values lie in [-1, 1] and can thus be negative. f_regression is
therefore recommended as a feature selection criterion to identify
potentially predictive feature for a downstream classifier, irrespective of
the sign of the association with the target variable.
X : {array-like, sparse matrix} of shape (n_samples, n_features)
The data matrix.
y : array-like of shape (n_samples,)
The target vector.
center : bool, default=True
Whether or not to center the data matrix X and the target vector y.
By default, X and y will be centered.
force_finite : bool, default=True
Whether or not to force the F-statistics and associated p-values to
be finite. There are two cases where the F-statistic is expected to not
be finite:
when the target y or some features in X are constant. In this
case, the Pearson’s R correlation is not defined leading to obtain
np.nan values in the F-statistic and p-value. When
force_finite=True, the F-statistic is set to 0.0 and the
associated p-value is set to 1.0.
when a feature in X is perfectly correlated (or
anti-correlated) with the target y. In this case, the F-statistic
is expected to be np.inf. When , the F-statistic
is set to and the associated p-value is set to
.