def test_iht_fit_sample():
 iht = InstanceHardnessThreshold(ESTIMATOR, random_state=RND_SEED)
 (X_resampled, y_resampled) = iht.fit_sample(X, Y)
 X_gt = np.array([[(-0.3879569), 0.6894251], [(-0.09322739), 1.28177189], [(-0.77740357), 0.74097941], [0.91542919, (-0.65453327)], [(-0.43877303), 1.07366684], [(-0.85795321), 0.82980738], [(-0.18430329), 0.52328473], [(-0.65571327), 0.42412021], [(-0.28305528), 0.30284991], [1.06446472, (-1.09279772)], [0.30543283, (-0.02589502)], [(-0.00717161), 0.00318087]])
 y_gt = np.array([0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 0, 0])
 assert_array_equal(X_resampled, X_gt)
 assert_array_equal(y_resampled, y_gt)

def test_iht_fit_sample ( ) : iht = InstanceHardnessThreshold ( ESTIMATOR , random_state = RND_SEED ) ( X_resampled , y_resampled ) = iht . fit_sample ( X , Y ) X_gt = np . array ( [ [ ( - 0.3879569 ) , 0.6894251 ] , [ ( - 0.09322739 ) , 1.28177189 ] , [ ( - 0.77740357 ) , 0.74097941 ] , [ 0.91542919 , ( - 0.65453327 ) ] , [ ( - 0.43877303 ) , 1.07366684 ] , [ ( - 0.85795321 ) , 0.82980738 ] , [ ( - 0.18430329 ) , 0.52328473 ] , [ ( - 0.65571327 ) , 0.42412021 ] , [ ( - 0.28305528 ) , 0.30284991 ] , [ 1.06446472 , ( - 1.09279772 ) ] , [ 0.30543283 , ( - 0.02589502 ) ] , [ ( - 0.00717161 ) , 0.00318087 ] ] ) y_gt = np . array ( [ 0 , 1 , 1 , 0 , 1 , 1 , 1 , 0 , 1 , 0 , 0 , 0 ] ) assert_array_equal ( X_resampled , X_gt ) assert_array_equal ( y_resampled , y_gt )
test the fit sample routine .