autobazaar.utils module

Functions

encode_score(scorer, expected, observed)

ensure_dir(directory)

Create diretory if it does not exist yet.

make_dumpable(params[, datetimes])

Get nested dicts of params to allow json dumping.

make_keras_picklable()

Make the keras models picklable.

remove_dots(document)

Replace dots with dashes in all the keys from the dictionary.

restore_dots(document)

Replace dashes with dots in all the keys from the dictionary.

autobazaar.utils.encode_score(scorer, expected, observed)[source]
autobazaar.utils.ensure_dir(directory)[source]

Create diretory if it does not exist yet.

autobazaar.utils.make_dumpable(params, datetimes=False)[source]

Get nested dicts of params to allow json dumping.

Also work around this: https://github.com/HDI-Project/BTB/issues/79 And convert numpy types to primitive types.

Optionally dump datetimes to ISO format.

Parameters
  • params (dict) – Params dictionary with tuples as keys.

  • datetimes (bool) – whether to convert datetimes to ISO strings or not.

Returns

Dumpable params as a tree of dicts and nested sub-dicts.

Return type

dict

autobazaar.utils.make_keras_picklable()[source]

Make the keras models picklable.

autobazaar.utils.remove_dots(document)[source]

Replace dots with dashes in all the keys from the dictionary.

autobazaar.utils.restore_dots(document)[source]

Replace dashes with dots in all the keys from the dictionary.