Skip to content

Commit

Permalink
fixed bug at ClimbsRocks#417
Browse files Browse the repository at this point in the history
  • Loading branch information
mohataher authored and mohataher committed Nov 1, 2018
1 parent 4b7e0e7 commit d75e0c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion auto_ml/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ def _pickle_method(m):
copyreg.pickle(types.MethodType, _pickle_method)


class ExtendedEvolutionaryAlgorithmSearchCV(EvolutionaryAlgorithmSearchCV):
def _run_search(cls):
"""required method on base class but not implemented; it causes a TypeError"""
pass

class Predictor(object):


Expand Down Expand Up @@ -1131,7 +1136,7 @@ def fit_grid_search(self, X_df, y, gs_params, feature_learning=False, refit=Fals
fit_evolutionary_search = True
# For some reason, EASCV doesn't play nicely with CatBoost. It blows up the memory hugely, and takes forever to train
if fit_evolutionary_search == True:
gs = EvolutionaryAlgorithmSearchCV(
gs = ExtendedEvolutionaryAlgorithmSearchCV(
# Fit on the pipeline.
ppl,
# Two splits of cross-validation, by default
Expand Down

1 comment on commit d75e0c2

@chjq201410695
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing the bug. But it does not work on my machine yet. the error as below:


TypeError Traceback (most recent call last)
in ()
11 'SGDClassifier'],
12 cv=4, feature_learning=False,fl_data = train_fl,
---> 13 prediction_intervals=True,compare_all_models=True)
14
15 ml_predictor.score(test, test.book)

~/.conda/envs/ML_DNN/lib/python3.6/site-packages/auto_ml/predictor.py in train(failed resolving arguments)
668
669 self.set_scoring(y)
--> 670
671 if self.X_test is not None and self.X_test_already_transformed == False:
672 self.X_test = self.transformation_pipeline.transform(self.X_test)

~/.conda/envs/ML_DNN/lib/python3.6/site-packages/auto_ml/predictor.py in train_ml_estimator(self, estimator_names, scoring, X_df, y, feature_learning, prediction_interval)
1267
1268 grid_search_params = self.create_gs_params(model_name)
-> 1269 # Adding model name to gs params just to help with logging
1270 grid_search_params['model'] = [utils_models.get_model_from_name(model_name)]
1271 # grid_search_params['model_name'] = model_name

~/.conda/envs/ML_DNN/lib/python3.6/site-packages/auto_ml/predictor.py in fit_grid_search(self, X_df, y, gs_params, feature_learning, refit)
1154 pre_dispatch='1.5*n_jobs',
1155 # The number of
-> 1156 population_size=population_size,
1157 gene_mutation_prob=gene_mutation_prob,
1158 tournament_size=tournament_size,

TypeError: Can't instantiate abstract class EvolutionaryAlgorithmSearchCV with abstract methods _run_search


Is there any other advise? Thanks again.

Please sign in to comment.