1313from pyquickhelper .texthelper import compare_module_version
1414from mlinsights .mlmodel import CategoriesToIntegers
1515from mlinsights .mlmodel import (
16- test_sklearn_pickle , test_sklearn_clone , test_sklearn_grid_search_cv )
16+ run_test_sklearn_pickle ,
17+ run_test_sklearn_clone ,
18+ run_test_sklearn_grid_search_cv )
1719
1820skipped_warnings = (ConvergenceWarning , UserWarning , FitFailedWarning )
1921
@@ -103,12 +105,12 @@ def test_categories_to_integers_pickle(self):
103105 data = os .path .join (os .path .abspath (
104106 os .path .dirname (__file__ )), "data" , "adult_set.txt" )
105107 df = pandas .read_csv (data , sep = "\t " )
106- test_sklearn_pickle (lambda : CategoriesToIntegers (skip_errors = True ), df )
108+ run_test_sklearn_pickle (lambda : CategoriesToIntegers (skip_errors = True ), df )
107109
108110 @ignore_warnings (skipped_warnings )
109111 def test_categories_to_integers_clone (self ):
110112 self .maxDiff = None
111- test_sklearn_clone (lambda : CategoriesToIntegers ())
113+ run_test_sklearn_clone (lambda : CategoriesToIntegers ())
112114
113115 @ignore_warnings (skipped_warnings )
114116 def test_categories_to_integers_grid_search (self ):
@@ -119,19 +121,19 @@ def test_categories_to_integers_grid_search(self):
119121 y = df ['income' ] # pylint: disable=E1136
120122 pipe = make_pipeline (CategoriesToIntegers (),
121123 LogisticRegression ())
122- self .assertRaise (lambda : test_sklearn_grid_search_cv (
124+ self .assertRaise (lambda : run_test_sklearn_grid_search_cv (
123125 lambda : pipe , df ), ValueError )
124126 if (compare_module_version (sklver , "0.24" ) >= 0 and # pylint: disable=R1716
125127 compare_module_version (pandas .__version__ , "1.3" ) < 0 ):
126128 self .assertRaise (
127- lambda : test_sklearn_grid_search_cv (
129+ lambda : run_test_sklearn_grid_search_cv (
128130 lambda : pipe , X , y , categoriestointegers__single = [True , False ]),
129131 ValueError , "Unable to find category value" )
130132 pipe = make_pipeline (CategoriesToIntegers (),
131133 Imputer (strategy = 'most_frequent' ),
132134 LogisticRegression (n_jobs = 1 ))
133135 try :
134- res = test_sklearn_grid_search_cv (
136+ res = run_test_sklearn_grid_search_cv (
135137 lambda : pipe , X , y , categoriestointegers__single = [True , False ],
136138 categoriestointegers__skip_errors = [True ])
137139 except AttributeError as e :
0 commit comments