File tree Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Expand file tree Collapse file tree 1 file changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ def test_loaded_model_works():
9696
9797#-------------------------------------------------------------------
9898
99- def test_model_works_data_range ():
99+ def test_model_works_data_range_sign_change ():
100100 # Small-valued data
101101 X ,y = fixed_data_constructor ()
102102 X = 1.0e-9 * X
@@ -119,6 +119,26 @@ def test_model_works_data_range():
119119 assert scores ['Train-score' ] == 1.0
120120 assert scores ['Test-score' ] == 1.0
121121
122+ # X-values are flipped
123+ X ,y = fixed_data_constructor ()
124+ X = - 1 * X
125+ filename = 'testing'
126+ scores = train_linear_model (X ,y , filename = filename )
127+
128+ # Check that test and train scores are perfectly equal to 1.0
129+ assert scores ['Train-score' ] == 1.0
130+ assert scores ['Test-score' ] == 1.0
131+
132+ # y-values are flipped
133+ X ,y = fixed_data_constructor ()
134+ y = - 1 * y
135+ filename = 'testing'
136+ scores = train_linear_model (X ,y , filename = filename )
137+
138+ # Check that test and train scores are perfectly equal to 1.0
139+ assert scores ['Train-score' ] == 1.0
140+ assert scores ['Test-score' ] == 1.0
141+
122142#-------------------------------------------------------------------
123143
124144def test_noise_impact ():
You can’t perform that action at this time.
0 commit comments