108dd7b00095a1265e6f0c4db0a69d620f590400,sklearn/tests/test_naive_bayes.py,,test_categoricalnb,#,687

Before Change


    X = np.array([[0, -1]])
    y = np.array([1])
    error_msg = "Negative values in data passed to CategoricalNB (input X)"
    assert_raise_message(ValueError, error_msg, clf.predict, X)
    assert_raise_message(ValueError, error_msg, clf.fit, X, y)

    // Test alpha
    X3_test = np.array([[2, 5]])

After Change


    // Check error is raised for X with negative entries
    X = np.array([[0, -1]])
    y = np.array([1])
    error_msg = re.escape(
        "Negative values in data passed to CategoricalNB (input X)"
    )
    with pytest.raises(ValueError, match=error_msg):
        clf.predict(X)
    with pytest.raises(ValueError, match=error_msg):
        clf.fit(X, y)

    // Test alpha
    X3_test = np.array([[2, 5]])
    // alpha=1 increases the count of all categories by one so the final
    // probability for each category is not 50/50 but 1/3 to 2/3
    bayes_numerator = np.array([[1/3*1/3, 2/3*2/3]])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: scikit-learn/scikit-learn
Commit Name: 108dd7b00095a1265e6f0c4db0a69d620f590400
Time: 2021-04-01
Author: alihanz@gmail.com
File Name: sklearn/tests/test_naive_bayes.py
Class Name:
Method Name: test_categoricalnb


Project Name: scikit-learn/scikit-learn
Commit Name: 108dd7b00095a1265e6f0c4db0a69d620f590400
Time: 2021-04-01
Author: alihanz@gmail.com
File Name: sklearn/tests/test_naive_bayes.py
Class Name:
Method Name: test_alpha_vector


Project Name: scikit-learn/scikit-learn
Commit Name: 8e310cd82698fa88108ad51f708dc7cad56a3039
Time: 2019-09-08
Author: 43701530+sameshl@users.noreply.github.com
File Name: sklearn/neural_network/tests/test_mlp.py
Class Name:
Method Name: test_warm_start


Project Name: scikit-learn/scikit-learn
Commit Name: 071ddc75e92917d372f84e20a7fca15c1b7c6ca0
Time: 2021-03-19
Author: 33635739+avigupta2612@users.noreply.github.com
File Name: sklearn/gaussian_process/tests/test_gpr.py
Class Name:
Method Name: test_gpr_correct_error_message