3131 (SGDClassifier ,
3232 {'loss' : ['hinge' , 'log' , 'modified_huber' , 'squared_hinge' ],
3333 'alpha' : [0.0001 , 0.001 , 0.1 ],
34- 'penalty_12none ' : penalty_12none
34+ 'penalty ' : penalty_12none
3535 }),
3636
3737 (LogisticRegression ,
38- {'penalty_12 ' : penalty_12 , 'max_iter' : max_iter , 'tol' : tol , 'warm_start' : warm_start , 'C' :C , 'solver' : ['liblinear' ]
38+ {'penalty ' : penalty_12 , 'max_iter' : max_iter , 'tol' : tol , 'warm_start' : warm_start , 'C' :C , 'solver' : ['liblinear' ]
3939 }),
4040
4141 (Perceptron ,
42- {'penalty_all ' : penalty_all , 'alpha' : alpha , 'n_iter' : n_iter , 'eta0' : eta0 , 'warm_start' : warm_start
42+ {'penalty ' : penalty_all , 'alpha' : alpha , 'n_iter' : n_iter , 'eta0' : eta0 , 'warm_start' : warm_start
4343 }),
4444
4545 (PassiveAggressiveClassifier ,
7373 }),
7474
7575 (LinearSVC ,
76- { 'C' : C , 'penalty_12 ' : penalty_12 , 'tol' : tol , 'max_iter' : max_iter ,
76+ { 'C' : C , 'penalty ' : penalty_12 , 'tol' : tol , 'max_iter' : max_iter ,
7777 'loss' : ['hinge' , 'squared_hinge' ],
7878 })
7979]
176176
177177def 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 ):
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 = False , brain = brain )
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 )
180180
181181
182182class HungaBungaClassifier (ClassifierMixin ):
@@ -195,6 +195,7 @@ def __init__(self, brain=False, test_size = 0.2, n_splits = 5, random_state=None
195195
196196 def fit (self , x , y ):
197197 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+ return self
198199
199200 def predict (self , x ):
200201 return self .model .predict (x )
0 commit comments