Did I find the right examples for you? yes no

All Samples(7)  |  Call(6)  |  Derive(0)  |  Import(1)

src/s/c/scikit-learn-0.14.1/sklearn/ensemble/tests/test_gradient_boosting_loss_functions.py   scikit-learn(Download)
 
 
from sklearn.ensemble.gradient_boosting import BinomialDeviance
from sklearn.ensemble.gradient_boosting import LogOddsEstimator
 
    Check against alternative definitions in ESLII.
    """
    bd = BinomialDeviance(2)
 
    # pred has the same BD for y in {0, 1}
    assert_equal(bd(np.array([0.0]), np.array([0.0])),
                 bd(np.array([1.0]), np.array([0.0])))
 
    assert_almost_equal(bd(np.array([1.0, 1.0, 1.0]),