def test_make_imbalance_multiclass():
 y_ = np.zeros(1000)
 y_[100:500] = 1
 y_[500:] = 2
 (X_, y_) = make_imbalance(X, y_, ratio=0.1, min_c_=0)
 counter = Counter(y_)
 assert_equal(counter[0], 90)
 assert_equal(counter[1], 400)
 assert_equal(counter[2], 500)
 assert_true(np.all([(X_i in X) for X_i in X_]))

def test_make_imbalance_multiclass ( ) : y_ = np . zeros ( 1000 ) y_ [ 100 : 500 ] = 1 y_ [ 500 : ] = 2 ( X_ , y_ ) = make_imbalance ( X , y_ , ratio = 0.1 , min_c_ = 0 ) counter = Counter ( y_ ) assert_equal ( counter [ 0 ] , 90 ) assert_equal ( counter [ 1 ] , 400 ) assert_equal ( counter [ 2 ] , 500 ) assert_true ( np . all ( [ ( X_i in X ) for X_i in X_ ] ) )
test make_imbalance with multiclass data .