cave.utils.io module

cave.utils.io.export_bokeh(plot, path, logger)[source]

Export bokeh-plot to png-file. Create directory if necessary

Parameters
  • plot (bokeh.plotting.figure) – bokeh plot to export

  • path (str) – path to save plot to

  • logger (Logger) – logger for debugging

cave.utils.io.load_config_csv(path, cs, logger)[source]

Load configurations.csv in the following format:

CONFIG_ID

parameter_name1

parameter_name2

0

value1

value2

Parameters
  • path (str) – path to csv-file

  • cs (ConfigurationSpace) – configspace with matching parameters

  • logger (Logger) – logger for debugs

Returns

(parameters, id_to_config) – parameter-names and dict mapping ids to Configurations

Return type

(str, dict)

cave.utils.io.load_csv_to_pandaframe(csv_path, logger, apply_numeric=True, delimiter=', ')[source]

Load csv-file and return pd.DataFrame. First line of file is expected to be the header.

Parameters
  • csv_path (str) – path to csv-file

  • logger (logging.Logger) – logger, for debugging

  • apply_numeric (boolean) – whether to an attempt should be taken to turn columns into numeric values.

  • delimiter (str) – can be used to determine custom delimiter

Returns

data_frame – csv-dataframe

Return type

pd.DataFrame