

def f_regression(X, y, center=True):
    'Univariate linear regression tests.\n\n    Quick linear model for testing the effect of a single regressor,\n    sequentially for many regressors.\n\n    This is done in 2 steps:\n\n    1. The cross correlation between each regressor and the target is computed,\n       that is, ((X[:, i] - mean(X[:, i])) * (y - mean_y)) / (std(X[:, i]) *\n       std(y)).\n    2. It is converted to an F score then to a p-value.\n\n    Read more in the :ref:`User Guide <univariate_feature_selection>`.\n\n    Parameters\n    ----------\n    X : {array-like, sparse matrix}  shape = (n_samples, n_features)\n        The set of regressors that will be tested sequentially.\n\n    y : array of shape(n_samples).\n        The data matrix\n\n    center : True, bool,\n        If true, X and y will be centered.\n\n    Returns\n    -------\n    F : array, shape=(n_features,)\n        F values of features.\n\n    pval : array, shape=(n_features,)\n        p-values of F-scores.\n\n    See also\n    --------\n    f_classif: ANOVA F-value between label/feature for classification tasks.\n    chi2: Chi-squared stats of non-negative features for classification tasks.\n    '
    if (issparse(X) and center):
        raise ValueError('center=True only allowed for dense data')
    (X, y) = check_X_y(X, y, ['csr', 'csc', 'coo'], dtype=np.float64)
    if center:
        y = (y - np.mean(y))
        X = X.copy('F')
        X -= center.mean(axis=0)
    corr = safe_sparse_dot(y, X)
    corr /= row_norms(X.T)
    corr /= norm(y)
    degrees_of_freedom = (y.size - (2 if center else 1))
    F = (((corr ** 2) / (1 - (corr ** 2))) * degrees_of_freedom)
    pv = stats.f.sf(F, 1, degrees_of_freedom)
    return (F, pv)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/feature_selection/univariate_selection.py f_regression/VarMisuse@93/597 `X`->`center`