1+ from urllib .error import URLError
2+
13import numpy as np
24import pandas as pd
35from sklearn .datasets import fetch_openml , load_iris
@@ -26,10 +28,10 @@ def _test(split_type):
2628
2729 try :
2830 X , y = fetch_openml (name = dataset , return_X_y = True )
29- except (ArffException , ValueError ):
30- from sklearn .datasets import load_wine
31+ except (ArffException , ValueError , URLError ):
32+ from sklearn .datasets import make_classification
3133
32- X , y = load_wine ( return_X_y = True )
34+ X , y = make_classification ( n_samples = 1000 , n_features = 20 , n_informative = 10 , random_state = 42 )
3335 if split_type != "time" :
3436 X_train , X_test , y_train , y_test = train_test_split (X , y , test_size = 0.33 , random_state = 42 )
3537 else :
@@ -55,10 +57,10 @@ def test_groups_for_classification_task():
5557
5658 try :
5759 X , y = fetch_openml (name = dataset , return_X_y = True )
58- except (ArffException , ValueError ):
59- from sklearn .datasets import load_wine
60+ except (ArffException , ValueError , URLError ):
61+ from sklearn .datasets import make_classification
6062
61- X , y = load_wine ( return_X_y = True )
63+ X , y = make_classification ( n_samples = 1000 , n_features = 20 , n_informative = 10 , random_state = 42 )
6264
6365 automl = AutoML ()
6466 automl_settings = {
@@ -193,10 +195,10 @@ def test_rank():
193195 try :
194196 X , y = fetch_openml (name = dataset , return_X_y = True )
195197 y = y .cat .codes
196- except (ArffException , ValueError ):
197- from sklearn .datasets import load_wine
198+ except (ArffException , ValueError , URLError ):
199+ from sklearn .datasets import make_classification
198200
199- X , y = load_wine ( return_X_y = True )
201+ X , y = make_classification ( n_samples = 1000 , n_features = 20 , n_informative = 10 , random_state = 42 )
200202 import numpy as np
201203
202204 automl = AutoML ()
@@ -230,10 +232,10 @@ def test_object():
230232
231233 try :
232234 X , y = fetch_openml (name = dataset , return_X_y = True )
233- except (ArffException , ValueError ):
234- from sklearn .datasets import load_wine
235+ except (ArffException , ValueError , URLError ):
236+ from sklearn .datasets import make_classification
235237
236- X , y = load_wine ( return_X_y = True )
238+ X , y = make_classification ( n_samples = 1000 , n_features = 20 , n_informative = 10 , random_state = 42 )
237239
238240 import numpy as np
239241
0 commit comments