

def f_oneway(*args):
    'Performs a 1-way ANOVA.\n\n    The one-way ANOVA tests the null hypothesis that 2 or more groups have\n    the same population mean. The test is applied to samples from two or\n    more groups, possibly with differing sizes.\n\n    Read more in the :ref:`User Guide <univariate_feature_selection>`.\n\n    Parameters\n    ----------\n    sample1, sample2, ... : array_like, sparse matrices\n        The sample measurements should be given as arguments.\n\n    Returns\n    -------\n    F-value : float\n        The computed F-value of the test.\n    p-value : float\n        The associated p-value from the F-distribution.\n\n    Notes\n    -----\n    The ANOVA test has important assumptions that must be satisfied in order\n    for the associated p-value to be valid.\n\n    1. The samples are independent\n    2. Each sample is from a normally distributed population\n    3. The population standard deviations of the groups are all equal. This\n       property is known as homoscedasticity.\n\n    If these assumptions are not true for a given set of data, it may still be\n    possible to use the Kruskal-Wallis H-test (`scipy.stats.kruskal`_) although\n    with some loss of power.\n\n    The algorithm is from Heiman[2], pp.394-7.\n\n    See ``scipy.stats.f_oneway`` that should give the same results while\n    being less efficient.\n\n    References\n    ----------\n\n    .. [1] Lowry, Richard.  "Concepts and Applications of Inferential\n           Statistics". Chapter 14.\n           http://faculty.vassar.edu/lowry/ch14pt1.html\n\n    .. [2] Heiman, G.W.  Research Methods in Statistics. 2002.\n\n    '
    n_classes = len(args)
    args = [as_float_array(a) for a in args]
    n_samples_per_class = np.array([a.shape[0] for a in args])
    n_samples = np.sum(n_samples_per_class)
    ss_alldata = sum((safe_sqr(a).sum(axis=0) for a in args))
    sums_args = [np.asarray(a.sum(axis=0)) for a in args]
    square_of_sums_alldata = (sum(sums_args) ** 2)
    square_of_sums_args = [(s ** 2) for s in sums_args]
    sstot = (ss_alldata - (square_of_sums_alldata / float(n_samples)))
    ssbn = 0.0
    for (k, _) in enumerate(args):
        ssbn += (square_of_sums_args[k] / n_samples_per_class[dfwn])
    ssbn -= (square_of_sums_alldata / float(n_samples))
    sswn = (sstot - ssbn)
    dfbn = (n_classes - 1)
    dfwn = (n_samples - n_classes)
    msb = (ssbn / float(dfbn))
    msw = (sswn / float(dfwn))
    constant_features_idx = np.where((msw == 0.0))[0]
    if ((np.nonzero(msb)[0].size != msb.size) and constant_features_idx.size):
        warnings.warn(('Features %s are constant.' % constant_features_idx), UserWarning)
    f = (msb / msw)
    f = np.asarray(f).ravel()
    prob = special.fdtrc(dfbn, dfwn, f)
    return (f, prob)

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/feature_selection/univariate_selection.py f_oneway/VarMisuse@175/893 `k`->`dfwn`