

def check_probability(name):
    ForestClassifier = FOREST_CLASSIFIERS[name]
    with np.errstate(divide='ignore'):
        clf = ForestClassifier(n_estimators=10, random_state=1, max_features=1, max_depth=1)
        clf.fit(iris.data, iris.target)
        assert_array_almost_equal(np.sum(clf.predict_proba(iris.data), axis=1), np.ones(iris.data.shape[0]))
        assert_array_almost_equal(clf.predict_proba(iris.data), np.exp(clf.predict_log_proba(iris.data)))

dataset/ETHPy150Open scikit-learn/scikit-learn/sklearn/ensemble/tests/test_forest.py check_probability/original