A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://scikit-learn.org/stable/modules/generated/sklearn.feature_selection.f_classif.html below:

f_classif — scikit-learn 1.7.0 documentation

f_classif#
sklearn.feature_selection.f_classif(X, y)[source]#

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.

yarray-like of shape (n_samples,)

The target vector.

Returns:
f_statisticndarray of shape (n_features,)

F-statistic for each feature.

p_valuesndarray 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

>>> from sklearn.datasets import make_classification
>>> from sklearn.feature_selection import f_classif
>>> X, y = make_classification(
...     n_samples=100, n_features=10, n_informative=2, n_clusters_per_class=1,
...     shuffle=False, random_state=42
... )
>>> f_statistic, p_values = f_classif(X, y)
>>> f_statistic
array([2.21e+02, 7.02e-01, 1.70e+00, 9.31e-01,
       5.41e+00, 3.25e-01, 4.71e-02, 5.72e-01,
       7.54e-01, 8.90e-02])
>>> p_values
array([7.14e-27, 4.04e-01, 1.96e-01, 3.37e-01,
       2.21e-02, 5.70e-01, 8.29e-01, 4.51e-01,
       3.87e-01, 7.66e-01])
Gallery examples#

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4