@@ -55,36 +55,43 @@ def test_loss_after_permutation(self):
55
55
variables = {}
56
56
for col in self .X .columns :
57
57
variables [col ] = col
58
- lap = utils .loss_after_permutation (self .X , self .y , self .exp .model , self .exp .predict_function , rmse ,
58
+ lap = utils .loss_after_permutation (self .X , self .y , None , self .exp .model , self .exp .predict_function , rmse ,
59
59
variables , 100 , np .random )
60
60
self .assertIsInstance (lap , pd .DataFrame )
61
61
self .assertTrue (np .isin (np .array (['_full_model_' , '_baseline_' ]),
62
62
lap .columns ).all (), np .random )
63
+
64
+ with self .assertRaises (UserWarning ):
65
+ lap = utils .loss_after_permutation (self .X , self .y , self .y , self .exp .model , self .exp .predict_function , rmse ,
66
+ variables , 100 , np .random )
67
+ self .assertIsInstance (lap , pd .DataFrame )
68
+ self .assertTrue (np .isin (np .array (['_full_model_' , '_baseline_' ]),
69
+ lap .columns ).all (), np .random )
63
70
64
71
variables = {'age' : 'age' , 'embarked' : 'embarked' }
65
- lap = utils .loss_after_permutation (self .X , self .y , self .exp .model , self .exp .predict_function , mad ,
72
+ lap = utils .loss_after_permutation (self .X , self .y , None , self .exp .model , self .exp .predict_function , mad ,
66
73
variables , 10 , np .random )
67
74
self .assertIsInstance (lap , pd .DataFrame )
68
75
self .assertTrue (np .isin (np .array (['_full_model_' , '_baseline_' ]),
69
76
lap .columns ).all ())
70
77
71
78
variables = {'embarked' : 'embarked' }
72
- lap = utils .loss_after_permutation (self .X , self .y , self .exp .model , self .exp .predict_function , mae ,
79
+ lap = utils .loss_after_permutation (self .X , self .y , None , self .exp .model , self .exp .predict_function , mae ,
73
80
variables , None , np .random )
74
81
self .assertIsInstance (lap , pd .DataFrame )
75
82
self .assertTrue (np .isin (np .array (['_full_model_' , '_baseline_' ]),
76
83
lap .columns ).all ())
77
84
78
85
variables = {'age' : 'age' }
79
- lap = utils .loss_after_permutation (self .X , self .y , self .exp .model , self .exp .predict_function , rmse ,
86
+ lap = utils .loss_after_permutation (self .X , self .y , None , self .exp .model , self .exp .predict_function , rmse ,
80
87
variables , None , np .random )
81
88
self .assertIsInstance (lap , pd .DataFrame )
82
89
self .assertTrue (np .isin (np .array (['_full_model_' , '_baseline_' ]),
83
90
lap .columns ).all ())
84
91
85
92
variables = {'personal' : ['gender' , 'age' , 'sibsp' , 'parch' ],
86
93
'wealth' : ['class' , 'fare' ]}
87
- lap = utils .loss_after_permutation (self .X , self .y , self .exp .model , self .exp .predict_function , mae ,
94
+ lap = utils .loss_after_permutation (self .X , self .y , None , self .exp .model , self .exp .predict_function , mae ,
88
95
variables , None , np .random )
89
96
self .assertIsInstance (lap , pd .DataFrame )
90
97
self .assertTrue (np .isin (np .array (['_full_model_' , '_baseline_' ]),
0 commit comments