@@ -966,8 +966,10 @@ def test_predict_params_expected_behavior_unaffected_by_fit_params() -> None:
966966
967967
968968def test_using_one_predict_parameter_into_predict_but_not_in_fit () -> None :
969- """Test that using predict parameters in the predict method
970- without using one predict_parameter in the fit method raises an error"""
969+ """
970+ Test that using predict parameters in the predict method
971+ without using predict_parameter in the fit method raises an error.
972+ """
971973 custom_gbr = CustomGradientBoostingRegressor (random_state = random_state )
972974 X_train , X_test , y_train , y_test = (
973975 train_test_split (X , y , test_size = 0.2 , random_state = random_state )
@@ -979,16 +981,18 @@ def test_using_one_predict_parameter_into_predict_but_not_in_fit() -> None:
979981 with pytest .raises (ValueError , match = (
980982 fr".*Using 'predict_param' '{ predict_params } ' "
981983 r"without using one 'predict_param' in the fit method\..*"
982- r"Please ensure one 'predict_param' "
983- r"is used in the fit method before calling predict\..*"
984+ r"Please ensure a similar configuration of 'predict_param' "
985+ r"is used in the fit method before calling it in predict\..*"
984986 )):
985987 mapie_fitted .predict (X_test , ** predict_params )
986988
987989
988990def test_using_one_predict_parameter_into_fit_but_not_in_predict () -> None :
989- """Test that using predict parameters in the fit method
990- without using one predict_parameter in
991- the predict method raises an error"""
991+ """
992+ Test that using predict parameters in the fit method
993+ without using predict_parameter in
994+ the predict method raises an error.
995+ """
992996 custom_gbr = CustomGradientBoostingRegressor (random_state = random_state )
993997 X_train , X_test , y_train , y_test = (
994998 train_test_split (X , y , test_size = 0.2 , random_state = random_state )
@@ -1000,14 +1004,16 @@ def test_using_one_predict_parameter_into_fit_but_not_in_predict() -> None:
10001004 with pytest .raises (ValueError , match = (
10011005 r"Using one 'predict_param' in the fit method "
10021006 r"without using one 'predict_param' in the predict method. "
1003- r"Please ensure one 'predict_param' "
1004- r"is used in the predict method before calling it ."
1007+ r"Please ensure a similar configuration of 'predict_param' "
1008+ r"is used in the predict method as called in the fit ."
10051009 )):
10061010 mapie_fitted .predict (X_test )
10071011
10081012
10091013def test_predict_infinite_intervals () -> None :
1010- """Test that MapieRegressor produces infinite bounds with alpha=0"""
1014+ """
1015+ Test that MapieRegressor produces infinite bounds with alpha=0
1016+ """
10111017 mapie_reg = MapieRegressor ().fit (X , y )
10121018 _ , y_pis = mapie_reg .predict (X , alpha = 0. , allow_infinite_bounds = True )
10131019 np .testing .assert_allclose (y_pis [:, 0 , 0 ], - np .inf )
@@ -1017,7 +1023,9 @@ def test_predict_infinite_intervals() -> None:
10171023@pytest .mark .parametrize ("method" , ["minmax" , "naive" , "plus" , "base" ])
10181024@pytest .mark .parametrize ("cv" , ["split" , "prefit" ])
10191025def test_check_change_method_to_base (method : str , cv : str ) -> None :
1020- """Test of the overloading of method attribute to `base` method in fit"""
1026+ """
1027+ Test of the overloading of method attribute to `base` method in fit
1028+ """
10211029
10221030 X_train , X_val , y_train , y_val = train_test_split (
10231031 X , y , test_size = 0.5 , random_state = random_state
0 commit comments