@@ -693,7 +693,7 @@ def test_calibration_display_compute(pyplot, iris_data_binary, n_bins, strategy)
693
693
assert_allclose (viz .prob_pred , prob_pred )
694
694
assert_allclose (viz .y_prob , y_prob )
695
695
696
- assert viz .name == "LogisticRegression"
696
+ assert viz .estimator_name == "LogisticRegression"
697
697
698
698
# cannot fail thanks to pyplot fixture
699
699
import matplotlib as mpl # noqa
@@ -715,7 +715,7 @@ def test_plot_calibration_curve_pipeline(pyplot, iris_data_binary):
715
715
clf .fit (X , y )
716
716
viz = CalibrationDisplay .from_estimator (clf , X , y )
717
717
assert clf .__class__ .__name__ in viz .line_ .get_label ()
718
- assert viz .name == clf .__class__ .__name__
718
+ assert viz .estimator_name == clf .__class__ .__name__
719
719
720
720
721
721
@pytest .mark .parametrize (
@@ -726,24 +726,23 @@ def test_calibration_display_default_labels(pyplot, name, expected_label):
726
726
prob_pred = np .array ([0.2 , 0.8 , 0.8 , 0.4 ])
727
727
y_prob = np .array ([])
728
728
729
- viz = CalibrationDisplay (prob_true , prob_pred , y_prob , name = name )
729
+ viz = CalibrationDisplay (prob_true , prob_pred , y_prob , estimator_name = name )
730
730
viz .plot ()
731
731
assert viz .line_ .get_label () == expected_label
732
732
733
733
734
734
def test_calibration_display_label_class_plot (pyplot ):
735
735
# Checks that when instantiating `CalibrationDisplay` class then calling
736
- # `plot`, `self.name ` is the one given in `plot`
736
+ # `plot`, `self.estimator_name ` is the one given in `plot`
737
737
prob_true = np .array ([0 , 1 , 1 , 0 ])
738
738
prob_pred = np .array ([0.2 , 0.8 , 0.8 , 0.4 ])
739
739
y_prob = np .array ([])
740
740
741
741
name = "name one"
742
- viz = CalibrationDisplay (prob_true , prob_pred , y_prob , name = name )
743
- assert viz .name == name
742
+ viz = CalibrationDisplay (prob_true , prob_pred , y_prob , estimator_name = name )
743
+ assert viz .estimator_name == name
744
744
name = "name two"
745
745
viz .plot (name = name )
746
- assert viz .name == name
747
746
assert viz .line_ .get_label () == name
748
747
749
748
@@ -764,7 +763,7 @@ def test_calibration_display_name_multiple_calls(
764
763
params = (clf , X , y ) if constructor_name == "from_estimator" else (y , y_prob )
765
764
766
765
viz = constructor (* params , name = clf_name )
767
- assert viz .name == clf_name
766
+ assert viz .estimator_name == clf_name
768
767
pyplot .close ("all" )
769
768
viz .plot ()
770
769
assert clf_name == viz .line_ .get_label ()
0 commit comments