Did I find the right examples for you? yes no

All Samples(22)  |  Call(13)  |  Derive(0)  |  Import(9)

src/s/c/scikit-learn-0.14.1/sklearn/tests/test_common.py   scikit-learn(Download)
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_array_almost_equal
def test_all_estimator_no_base_class():
    for name, Estimator in all_estimators():
        msg = ("Base estimators such as {0} should not be included"
               " in all_estimators").format(name)
        assert_false(name.lower().startswith('base'), msg=msg)
            new_params = estimator.get_params()
            for k, v in params.items():
                assert_false(np.any(new_params[k] != v),
                             "Estimator %s changes its parameter %s"
                             " from %s to %s during fit."
        new_params = clustering.get_params()
        for k, v in params.items():
            assert_false(np.any(new_params[k] != v),
                         "Estimator %s changes its parameter %s"
                         " from %s to %s during fit."

src/s/c/scikit-learn-0.14.1/sklearn/decomposition/tests/test_nmf.py   scikit-learn(Download)
 
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import raises
from sklearn.utils.testing import assert_array_almost_equal
    for var in (None, 'a', 'ar'):
        W, H = nmf._initialize_nmf(data, 10, random_state=0)
        assert_false((W < 0).any() or (H < 0).any())
 
 
                                         random_state=0)
        transf = model.fit_transform(A)
        assert_false((model.components_ < 0).any() or
                     (transf < 0).any())
 
def test_nls_nn_output():
    """Test that NLS solver doesn't return negative values"""
    A = np.arange(1, 5).reshape(1, -1)
    Ap, _, _ = nmf._nls_subproblem(np.dot(A.T, -A), A.T, A, 0.001, 100)
    assert_false((Ap < 0).any())

src/s/c/scikit-learn-0.14.1/sklearn/tests/test_multiclass.py   scikit-learn(Download)
from sklearn.utils.testing import assert_almost_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_raises
 
    # sample has the label is greater than 0.5.
    pred = np.array([l.argmax() for l in Y_proba])
    assert_false((pred - Y_pred).any())
 
 

src/s/c/scikit-learn-0.14.1/sklearn/tests/test_base.py   scikit-learn(Download)
from sklearn.utils.testing import assert_array_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_raises
    selector.own_attribute = "test"
    new_selector = clone(selector)
    assert_false(hasattr(new_selector, "own_attribute"))
 
 

src/s/c/scikit-learn-0.14.1/sklearn/datasets/tests/test_base.py   scikit-learn(Download)
from sklearn.externals.six import b, u
 
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_equal
    # clear_data_home will delete both the content and the folder it-self
    clear_data_home(data_home=data_home)
    assert_false(os.path.exists(data_home))
 
    # if the folder is missing it will be created again

src/s/c/scikit-learn-0.14.1/sklearn/decomposition/tests/test_sparse_pca.py   scikit-learn(Download)
from sklearn.utils.testing import SkipTest
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
 
from sklearn.decomposition import SparsePCA, MiniBatchSparsePCA
    Y[:, 0] = 0
    estimator = SparsePCA(n_components=8)
    assert_false(np.any(np.isnan(estimator.fit_transform(Y))))
 
 

src/s/c/scikit-learn-0.14.1/sklearn/tests/test_pipeline.py   scikit-learn(Download)
from sklearn.utils.testing import assert_raises
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_equal
    # Test clone
    pipe2 = clone(pipe)
    assert_false(pipe.named_steps['svc'] is pipe2.named_steps['svc'])
 
    # Check that apart from estimators, the parameters are the same

src/s/c/scikit-learn-0.14.1/sklearn/cluster/tests/test_mean_shift.py   scikit-learn(Download)
import numpy as np
 
from sklearn.utils.testing import assert_equal, assert_false, assert_true
 
from sklearn.cluster import MeanShift
def test_unfitted():
    """Non-regression: before fit, there should be not fitted attributes."""
    ms = MeanShift()
    assert_false(hasattr(ms, "cluster_centers_"))
    assert_false(hasattr(ms, "labels_"))

src/s/c/scikit-learn-0.14.1/sklearn/utils/tests/test_multiclass.py   scikit-learn(Download)
from sklearn.utils.testing import assert_equal
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_false
from sklearn.utils.testing import assert_raises