174174]
175175
176176
177- def run_all_classifiers (x , y , small = True , normalize_x = True , n_jobs = cpu_count ()- 1 , brain = False , test_size = 0.2 , n_splits = 5 , upsample = True , scoring = None , verbose = False ):
177+ def run_all_classifiers (x , y , small = True , normalize_x = True , n_jobs = cpu_count ()- 1 , brain = False , test_size = 0.2 , n_splits = 5 , upsample = True , scoring = None , verbose = False , grid_search = True ):
178178 all_params = (linear_models_n_params_small if small else linear_models_n_params ) + (nn_models_n_params_small if small else nn_models_n_params ) + ([] if small else gaussianprocess_models_n_params ) + neighbor_models_n_params + (svm_models_n_params_small if small else svm_models_n_params ) + (tree_models_n_params_small if small else tree_models_n_params )
179- return main_loop (all_params , StandardScaler ().fit_transform (x ) if normalize_x else x , y , isClassification = True , n_jobs = n_jobs , verbose = verbose , brain = brain , test_size = test_size , n_splits = n_splits , upsample = upsample , scoring = scoring )
179+ return main_loop (all_params , StandardScaler ().fit_transform (x ) if normalize_x else x , y , isClassification = True , n_jobs = n_jobs , verbose = verbose , brain = brain , test_size = test_size , n_splits = n_splits , upsample = upsample , scoring = scoring , grid_search = grid_search )
180180
181181
182182class HungaBungaClassifier (ClassifierMixin ):
183- def __init__ (self , brain = False , test_size = 0.2 , n_splits = 5 , random_state = None , upsample = True , scoring = None , verbose = False , normalize_x = True , n_jobs = cpu_count () - 1 ):
183+ def __init__ (self , brain = False , test_size = 0.2 , n_splits = 5 , random_state = None , upsample = True , scoring = None , verbose = False , normalize_x = True , n_jobs = cpu_count () - 1 , grid_search = True ):
184184 self .model = None
185185 self .brain = brain
186186 self .test_size = test_size
@@ -191,10 +191,11 @@ def __init__(self, brain=False, test_size = 0.2, n_splits = 5, random_state=None
191191 self .verbose = verbose
192192 self .n_jobs = n_jobs
193193 self .normalize_x = normalize_x
194+ self .grid_search = grid_search
194195 super (HungaBungaClassifier , self ).__init__ ()
195196
196197 def fit (self , x , y ):
197- self .model = run_all_classifiers (x , y , normalize_x = self .normalize_x , test_size = self .test_size , n_splits = self .n_splits , upsample = self .upsample , scoring = self .scoring , verbose = self .verbose , brain = self .brain , n_jobs = self .n_jobs )[0 ]
198+ self .model = run_all_classifiers (x , y , normalize_x = self .normalize_x , test_size = self .test_size , n_splits = self .n_splits , upsample = self .upsample , scoring = self .scoring , verbose = self .verbose , brain = self .brain , n_jobs = self .n_jobs , grid_search = self . grid_search )[0 ]
198199 return self
199200
200201 def predict (self , x ):
0 commit comments