@@ -978,7 +978,7 @@ def test_custom_feature_names():
978
978
n_jobs = 1 )
979
979
980
980
sfs1 = sfs1 .fit (X , y , custom_feature_names = (
981
- 'sepal length' , 'sepal width' , 'petal length' , 'petal width' ))
981
+ 'sepal length' , 'sepal width' , 'petal length' , 'petal width' ))
982
982
assert sfs1 .k_feature_idx_ == (1 , 3 )
983
983
assert sfs1 .k_feature_names_ == ('sepal width' , 'petal width' )
984
984
assert sfs1 .subsets_ [2 ]['feature_names' ] == ('sepal width' ,
@@ -1000,13 +1000,12 @@ def test_run_forward_earlystop():
1000
1000
k_features = 'best' ,
1001
1001
forward = True ,
1002
1002
floating = False ,
1003
- early_stop = True ,
1004
1003
early_stop_rounds = esr ,
1005
1004
verbose = 0 )
1006
1005
sfs .fit (X_iris_with_noise , y_iris )
1007
1006
assert len (sfs .subsets_ ) < X_iris_with_noise .shape [1 ]
1008
- assert all ([sfs .subsets_ [ list ( sfs .subsets_ )[ - esr - 1 ] ]['avg_score' ]
1009
- >= sfs . subsets_ [ i ][ 'avg_score' ] for i in sfs .subsets_ . keys () ])
1007
+ assert all ([sfs .k_score_ >= sfs .subsets_ [ i ]['avg_score' ]
1008
+ for i in sfs .subsets_ ])
1010
1009
1011
1010
1012
1011
def test_run_backward_earlystop ():
@@ -1024,10 +1023,9 @@ def test_run_backward_earlystop():
1024
1023
k_features = 'best' ,
1025
1024
forward = False ,
1026
1025
floating = False ,
1027
- early_stop = True ,
1028
1026
early_stop_rounds = esr ,
1029
1027
verbose = 0 )
1030
1028
sfs .fit (X_iris_with_noise , y_iris )
1031
1029
assert len (sfs .subsets_ ) > 1
1032
- assert all ([sfs .subsets_ [ list ( sfs .subsets_ )[ - esr - 1 ] ]['avg_score' ]
1033
- >= sfs . subsets_ [ i ][ 'avg_score' ] for i in sfs .subsets_ . keys () ])
1030
+ assert all ([sfs .k_score_ >= sfs .subsets_ [ i ]['avg_score' ]
1031
+ for i in sfs .subsets_ ])
0 commit comments