Did I find the right examples for you? yes no

All Samples(16)  |  Call(14)  |  Derive(0)  |  Import(2)

src/s/c/scikit-learn-0.14.1/sklearn/utils/tests/test_testing.py   scikit-learn(Download)
from nose.tools import assert_raises
 
from sklearn.utils.testing import (
    _assert_less,
    _assert_greater,
def test_set_random_state():
    lda = LDA()
    tree = DecisionTreeClassifier()
    # LDA doesn't have random state: smoke test
    set_random_state(lda, 3)
    set_random_state(tree, 3)

src/s/c/scikit-learn-0.14.1/sklearn/tests/test_common.py   scikit-learn(Download)
from sklearn.utils.testing import all_estimators
from sklearn.utils.testing import meta_estimators
from sklearn.utils.testing import set_random_state
from sklearn.utils.testing import assert_greater
 
        with warnings.catch_warnings(record=True):
            transformer = Transformer()
        set_random_state(transformer)
        if hasattr(transformer, 'compute_importances'):
            transformer.compute_importances = True
                    estimator = Estimator(n_components=1)
 
                set_random_state(estimator, 1)
                # try to fit
                try:
        if not hasattr(transformer, 'transform'):
            continue
        set_random_state(transformer)
        if hasattr(transformer, 'compute_importances'):
            transformer.compute_importances = True
            if hasattr(alg, "n_clusters"):
                alg.set_params(n_clusters=3)
            set_random_state(alg)
            if name == 'AffinityPropagation':
                alg.set_params(preference=-100)