File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
sklearn/linear_model/tests Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 11
11
from sklearn .utils .testing import assert_raises
12
12
from sklearn .utils .testing import assert_true
13
13
from sklearn .utils .testing import assert_warns
14
+ from sklearn .utils .testing import assert_warns_message
14
15
from sklearn .utils .testing import raises
15
16
from sklearn .utils .testing import ignore_warnings
16
17
from sklearn .utils .testing import assert_raise_message
@@ -657,6 +658,15 @@ def test_logistic_regression_class_weights():
657
658
assert_array_almost_equal (clf1 .coef_ , clf2 .coef_ , decimal = 6 )
658
659
659
660
661
+ def test_multinomial_logistic_regression_with_classweight_auto ():
662
+ X , y = iris .data , iris .target
663
+ model = LogisticRegression (multi_class = 'multinomial' ,
664
+ class_weight = 'auto' , solver = 'lbfgs' )
665
+ assert_warns_message (DeprecationWarning ,
666
+ "class_weight='auto' heuristic is deprecated" ,
667
+ model .fit , X , y )
668
+
669
+
660
670
def test_logistic_regression_convergence_warnings ():
661
671
# Test that warnings are raised if model does not converge
662
672
You can’t perform that action at this time.
0 commit comments