def test_renn_sample_wrong_X():
    """Test either if an error is raised when X is different at fitting
    and sampling"""

    # Create the object
    renn = RepeatedEditedNearestNeighbours(random_state=RND_SEED)
    renn.fit(X, Y)
    assert_raises(RuntimeError, renn.sample,
                  np.random.random((100, 40)), np.array([0] * 50 + [1] * 50))
예제 #2
0
def test_renn_sample_wrong_X():
    """Test either if an error is raised when X is different at fitting
    and sampling"""

    # Create the object
    renn = RepeatedEditedNearestNeighbours(random_state=RND_SEED)
    renn.fit(X, Y)
    assert_raises(RuntimeError, renn.sample, np.random.random((100, 40)),
                  np.array([0] * 50 + [1] * 50))
예제 #3
0
def test_renn_fit():
    """Test the fitting method"""

    # Create the object
    renn = RepeatedEditedNearestNeighbours(random_state=RND_SEED)
    # Fit the data
    renn.fit(X, Y)

    # Check if the data information have been computed
    assert_equal(renn.min_c_, 0)
    assert_equal(renn.maj_c_, 1)
    assert_equal(renn.stats_c_[0], 500)
    assert_equal(renn.stats_c_[1], 4500)
def test_renn_fit():
    """Test the fitting method"""

    # Create the object
    renn = RepeatedEditedNearestNeighbours(random_state=RND_SEED)
    # Fit the data
    renn.fit(X, Y)

    # Check if the data information have been computed
    assert_equal(renn.min_c_, 0)
    assert_equal(renn.maj_c_, 1)
    assert_equal(renn.stats_c_[0], 500)
    assert_equal(renn.stats_c_[1], 4500)