def test_iht_bad_ratio():
 ratio = (-1.0)
 iht = InstanceHardnessThreshold(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, iht.fit, X, Y)
 ratio = 100.0
 iht = InstanceHardnessThreshold(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, iht.fit, X, Y)
 ratio = 'rnd'
 iht = InstanceHardnessThreshold(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, iht.fit, X, Y)
 ratio = [0.5, 0.5]
 iht = InstanceHardnessThreshold(ratio=ratio, random_state=RND_SEED)
 assert_raises(ValueError, iht.fit, X, Y)

def test_iht_bad_ratio ( ) : ratio = ( - 1.0 ) iht = InstanceHardnessThreshold ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , iht . fit , X , Y ) ratio = 100.0 iht = InstanceHardnessThreshold ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , iht . fit , X , Y ) ratio = 'rnd' iht = InstanceHardnessThreshold ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , iht . fit , X , Y ) ratio = [ 0.5 , 0.5 ] iht = InstanceHardnessThreshold ( ratio = ratio , random_state = RND_SEED ) assert_raises ( ValueError , iht . fit , X , Y )
test either if an error is raised with a wrong decimal value for the ratio .