@@ -185,17 +185,6 @@ def test_sgd_bad_penalty(self):
185
185
"""Check whether expected ValueError on bad penalty"""
186
186
self .factory (penalty = 'foobar' , rho = 0.85 )
187
187
188
- def test_sgd_losses (self ):
189
- """Check whether losses and hyperparameters are set properly"""
190
- clf = self .factory (loss = 'hinge' )
191
- assert_true (isinstance (clf .loss_function , linear_model .Hinge ))
192
-
193
- clf = self .factory (loss = 'log' )
194
- assert_true (isinstance (clf .loss_function , linear_model .Log ))
195
-
196
- clf = self .factory (loss = 'modified_huber' )
197
- assert_true (isinstance (clf .loss_function , linear_model .ModifiedHuber ))
198
-
199
188
@raises (ValueError )
200
189
def test_sgd_bad_loss (self ):
201
190
"""Check whether expected ValueError on bad loss"""
@@ -562,15 +551,6 @@ def test_sgd_bad_penalty(self):
562
551
"""Check whether expected ValueError on bad penalty"""
563
552
self .factory (penalty = 'foobar' , rho = 0.85 )
564
553
565
- def test_sgd_losses (self ):
566
- """Check whether losses and hyperparameters are set properly"""
567
- clf = self .factory (loss = 'squared_loss' )
568
- assert_true (isinstance (clf .loss_function , linear_model .SquaredLoss ))
569
-
570
- clf = self .factory (loss = 'huber' , epsilon = 0.5 )
571
- assert_true (isinstance (clf .loss_function , linear_model .Huber ))
572
- assert_equal (clf .epsilon , 0.5 )
573
-
574
554
@raises (ValueError )
575
555
def test_sgd_bad_loss (self ):
576
556
"""Check whether expected ValueError on bad loss"""
@@ -715,6 +695,11 @@ def test_partial_fit_equal_fit_optimal(self):
715
695
def test_partial_fit_equal_fit_invscaling (self ):
716
696
self ._test_partial_fit_equal_fit ("invscaling" )
717
697
698
+ def test_loss_function_epsilon (self ):
699
+ clf = self .factory (epsilon = 0.9 )
700
+ clf .set_params (epsilon = 0.1 )
701
+ assert clf .loss_functions ['huber' ][1 ] == 0.1
702
+
718
703
719
704
class SparseSGDRegressorTestCase (DenseSGDRegressorTestCase ):
720
705
"""Run exactly the same tests using the sparse representation variant"""
0 commit comments