@@ -348,25 +348,24 @@ def check_estimators_dtypes(name, Estimator):
348
348
349
349
350
350
def check_estimators_empty_data_messages (name , Estimator , multi_output = False ):
351
- with warnings .catch_warnings (record = True ):
352
- e = Estimator ()
353
- set_fast_parameters (e )
354
- set_random_state (e , 1 )
355
-
356
- X_zero_samples = np .empty (0 ).reshape (0 , 3 )
357
- # The precise message can change depending on whether X or y is
358
- # validated first. Let us test the type of exception only:
359
- assert_raises (ValueError , e .fit , X_zero_samples , [])
360
-
361
- X_zero_features = np .empty (0 ).reshape (3 , 0 )
362
- # the following y should be accepted by both classifiers and regressors
363
- # and ignored by unsupervised models
364
- if multi_output :
365
- y = np .array ([[1 , 1 ], [0 , 1 ], [0 , 1 ]])
366
- else :
367
- y = [1 , 0 , 1 ]
368
- msg = "0 feature(s) (shape=(3, 0)) while a minimum of 1 is required."
369
- assert_raise_message (ValueError , msg , e .fit , X_zero_features , y )
351
+ e = Estimator ()
352
+ set_fast_parameters (e )
353
+ set_random_state (e , 1 )
354
+
355
+ X_zero_samples = np .empty (0 ).reshape (0 , 3 )
356
+ # The precise message can change depending on whether X or y is
357
+ # validated first. Let us test the type of exception only:
358
+ assert_raises (ValueError , e .fit , X_zero_samples , [])
359
+
360
+ X_zero_features = np .empty (0 ).reshape (3 , 0 )
361
+ # the following y should be accepted by both classifiers and regressors
362
+ # and ignored by unsupervised models
363
+ if multi_output :
364
+ y = np .array ([[1 , 1 ], [0 , 1 ], [0 , 1 ]])
365
+ else :
366
+ y = [1 , 0 , 1 ]
367
+ msg = "0 feature(s) (shape=(3, 0)) while a minimum of 1 is required."
368
+ assert_raise_message (ValueError , msg , e .fit , X_zero_features , y )
370
369
371
370
372
371
def check_estimators_nan_inf (name , Estimator ):
0 commit comments