0

I know how to specify Feature Selection methods and the list of the Algorithms used in Auto-Sklearn 2.0

mdl = autosklearn.classification.AutoSklearnClassifier(
    include = {
         'classifier': ["random_forest", "gaussian_nb", "libsvm_svc", "adaboost"],
         'feature_preprocessor': ["no_preprocessing"]
    },
    exclude=None)

I know that Auto-Sklearn use Bayesian Optimisation SMAC

but I would like to specify the HyperParameters in AutoSklearn

For example, I want to specify random_forest with Estimator = 1000 only or MLP with HiddenLayerSize = 100 only.

How to do that?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
asmgx
  • 7,328
  • 15
  • 82
  • 143

1 Answers1

2

You need to edit the config as specified in the docs.

In your case it would be something like:

cs = mdl.get_configuration_space(X, y)
config = cs.sample_configuration()
config._values['classifier:random_forest:n_estimators'] = 1000
pipeline, run_info, run_value = mdl.fit_pipeline(X=X_train, y=y_train,
                                                 config=config,
                                                 X_test=X_test, y_test=y_test)
  • Does this work the same way with Auto-Sklearn? I mean in this case Auto-Sklearn will not search its own space for hyperparameters? – asmgx Jan 20 '22 at 18:49
  • I am getting this error "FileNotFoundError: [Errno 2] No such file or directory: '/tmp/autosklearn_tmp_2aa5c099-7be7-11ec-8dc8-080027f43971/.auto-sklearn/datamanager.pkl'" Any idea how to resolve?! – asmgx Jan 23 '22 at 00:58