Toggle Menu
Prev Up Next

scikit-learn 1.3.2
Other versions

Please cite us if you use the software.

# `sklearn.feature_selection`.f_classif

sklearn.feature_selection.f_classif(X, y)

  Compute the ANOVA F-value for the provided sample.

  Read more in the User Guide.

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

      The set of regressors that will be tested sequentially.

    y array-like of shape (n_samples,)

      The target vector.

  Returns:
    f_statistic ndarray of shape (n_features,)

      F-statistic for each feature.

    p_values ndarray of shape (n_features,)

      P-values associated with the F-statistic.

  See also

  `chi2`

    Chi-squared stats of non-negative features for classification tasks.

  `f_regression`

    F-value between label/feature for regression tasks.

## Examples using `sklearn.feature_selection.f_classif`

Pipeline ANOVA SVM

Pipeline ANOVA SVM

Univariate Feature Selection

Univariate Feature Selection

SVM-Anova: SVM with univariate feature selection

SVM-Anova: SVM with univariate feature selection