0f242eb4d4697d1ddef2f4b247d55be219984872,imblearn/under_sampling/tests/test_nearmiss_3.py,,test_nearmiss_bad_ratio,#,31
Before Change
// Define a negative ratio
ratio = -1.0
assert_raises(ValueError, NearMiss, ratio=ratio)
// Define a ratio greater than 1
ratio = 100.0
assert_raises(ValueError, NearMiss, ratio=ratio)
After Change
// Define a negative ratio
ratio = -1.0
nm1 = NearMiss(ratio=ratio, random_state=RND_SEED)
assert_raises(ValueError, nm1.fit, X, Y)
// Define a ratio greater than 1
ratio = 100.0
nm1 = NearMiss(ratio=ratio, random_state=RND_SEED)
assert_raises(ValueError, nm1.fit, X, Y)
// Define ratio as an unknown string
ratio = "rnd"
nm1 = NearMiss(ratio=ratio, random_state=RND_SEED)
assert_raises(ValueError, nm1.fit, X, Y)
// Define ratio as a list which is not supported
ratio = [.5, .5]
nm1 = NearMiss(ratio=ratio, random_state=RND_SEED)
assert_raises(ValueError, nm1.fit, X, Y)
def test_nearmiss_wrong_version():
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 0f242eb4d4697d1ddef2f4b247d55be219984872
Time: 2016-07-05
Author: glemaitre@visor.udg.edu
File Name: imblearn/under_sampling/tests/test_nearmiss_3.py
Class Name:
Method Name: test_nearmiss_bad_ratio
Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 0f242eb4d4697d1ddef2f4b247d55be219984872
Time: 2016-07-05
Author: glemaitre@visor.udg.edu
File Name: imblearn/under_sampling/tests/test_nearmiss_2.py
Class Name:
Method Name: test_nearmiss_bad_ratio
Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 0f242eb4d4697d1ddef2f4b247d55be219984872
Time: 2016-07-05
Author: glemaitre@visor.udg.edu
File Name: imblearn/under_sampling/tests/test_nearmiss_3.py
Class Name:
Method Name: test_nearmiss_bad_ratio
Project Name: scikit-learn-contrib/imbalanced-learn
Commit Name: 0f242eb4d4697d1ddef2f4b247d55be219984872
Time: 2016-07-05
Author: glemaitre@visor.udg.edu
File Name: imblearn/under_sampling/tests/test_nearmiss_1.py
Class Name:
Method Name: test_nearmiss_bad_ratio