code: def get_dict(task_type="classifier", **kwargs):
      assert task_type in ("classifier", "regressor")
  
      if task_type == "classifier":
          cs = autosklearn.pipeline.classification.SimpleClassificationPipeline.get_hyperparameter_search_space(
              dataset_properties=kwargs
          )
      elif task_type == "regressor":
          cs = autosklearn.pipeline.regression.SimpleRegressionPipeline.get_hyperparameter_search_space(
              dataset_properties=kwargs
          )
      else:
          raise ValueError(
              "'task_type' is not in ('classifier', 'regressor')"
          )
  
      preprocessor = None
      estimator = None
  
      for h in cs.get_hyperparameters():
          if h.name == "feature_preprocessor:__choice__":
              preprocessor = h
          elif h.name == (task_type + ":__choice__"):
              estimator = h
  
      if estimator is None:
          raise ValueError("No classifier found")
      elif preprocessor is None:
          raise ValueError("No preprocessor found")
  
      estimator_dict = OrderedDict()
      for i in sorted(estimator.choices):
          estimator_dict[i] = OrderedDict()
          estimator_dict[i][COND] = OrderedDict()
          for t in (CAT, CONT, CONST):
              estimator_dict[i][t] = 0
              estimator_dict[i][COND][t] = 0
          estimator_dict[i][UN] = 0
  
      preprocessor_dict = OrderedDict()
      for i in sorted(preprocessor.choices):
          preprocessor_dict[i] = OrderedDict()
          preprocessor_dict[i][COND] = OrderedDict()
          for t in (CAT, CONT, CONST):
              preprocessor_dict[i][t] = 0
              preprocessor_dict[i][COND][t] = 0
          preprocessor_dict[i][UN] = 0
  
      for h in cs.get_hyperparameters():
          if h.name == "feature_preprocessor:__choice__" or h.name == (
              task_type + ":__choice__"
          ):
              continue
          # walk over both dicts
          for d in (estimator_dict, preprocessor_dict):
              est = h.name.split(":")[1]
              if est not in d:
                  continue
              if isinstance(
                  h,
                  ConfigSpace.hyperparameters.UniformIntegerHyperparameter,
              ):
                  d[est][CONT] += 1
              elif isinstance(
                  h,
                  ConfigSpace.hyperparameters.UniformFloatHyperparameter,
              ):
                  d[est][CONT] += 1
              elif isinstance(
                  h,
                  ConfigSpace.hyperparameters.CategoricalHyperparameter,
              ):
                  d[est][CAT] += 1
              elif isinstance(h, ConfigSpace.hyperparameters.Constant):
                  d[est][CONST] += 1
              elif isinstance(
                  h,
                  ConfigSpace.hyperparameters.UnParametrizedHyperparameter,
              ):
                  d[est][UN] += 1
              else:
                  raise ValueError("Don't know that type: %s" % type(h))
  
      for h in cs.get_conditions():
          if (
              h.parent.name == (task_type + ":__choice__")
              or h.parent.name == "feature_preprocessor:__choice__"
          ):
              # ignore this condition
              # print "IGNORE", h
              continue
  
          # walk over both dicts and collect hyperparams
          for d in (estimator_dict, preprocessor_dict):
              est = h.child.name.split(":")[1]
              if est not in d:
                  # print "Could not find %s" % est
                  continue
  
              # print "####"
              # print vars(h)
              # print h.parent
              # print type(h)
              if isinstance(
                  h.child,
                  ConfigSpace.hyperparameters.UniformIntegerHyperparameter,
              ):
                  d[est][COND][CONT] += 1
              elif isinstance(
                  h.child,
                  ConfigSpace.hyperparameters.UniformFloatHyperparameter,
              ):
                  d[est][COND][CONT] += 1
              elif isinstance(
                  h.child,
                  ConfigSpace.hyperparameters.CategoricalHyperparameter,
              ):
                  d[est][COND][CAT] += 1
              elif isinstance(
                  h.child, ConfigSpace.hyperparameters.Constant
              ):
                  d[est][COND][CONST] += 1
              elif isinstance(
                  h.child,
                  ConfigSpace.hyperparameters.UnParametrizedHyperparameter,
              ):
                  d[est][COND][UN] += 1
              else:
                  raise ValueError("Don't know that type: %s" % type(h))
      print(preprocessor_dict)
      return (estimator_dict, preprocessor_dict)
  
file_path: auto-sklearn/misc/create_hyperparameter_table.py
imports: from argparse import ArgumentParser
  from collections import OrderedDict
  import os
  import shlex
  import subprocess
  import ConfigSpace.hyperparameters
  import autosklearn.pipeline.classification
  import autosklearn.pipeline.regression
label_desc: Use image node_id 1 for calling a global function with example usage: get_dict(task_type) and returns: estimator_dict,  preprocessor_dict