elliot.utils package

Submodules

elliot.utils.folder module

Module description:

elliot.utils.folder.build_log_folder(path_log_folder)[source]
elliot.utils.folder.build_model_folder(path_output_rec_weight, model)[source]
elliot.utils.folder.create_folder_by_index(path, index)[source]
elliot.utils.folder.manage_directories(path_output_rec_result, path_output_rec_weight, path_output_rec_performance)[source]

elliot.utils.logger_util module

class elliot.utils.logger_util.QueueListenerHandler(handlers, respect_handler_level=False, auto_run=True, queue=<queue.Queue object>)[source]

Bases: logging.handlers.QueueHandler

emit(record)[source]

Emit a record.

Writes the LogRecord to the queue, preparing it for pickling first.

start()[source]
stop()[source]

elliot.utils.logging module

class elliot.utils.logging.TimeFilter(name='')[source]

Bases: logging.Filter

filter(record: logging.LogRecord)bool[source]

Determine if the specified record is to be logged.

Is the specified record to be logged? Returns 0 for no, nonzero for yes. If deemed appropriate, the record may be modified in-place.

elliot.utils.logging.get_logger(name, log_level=10)[source]
elliot.utils.logging.get_logger_model(name, log_level=10)[source]
elliot.utils.logging.init(path_config, folder_log, log_level=30)[source]
elliot.utils.logging.prepare_logger(name, path, log_level=10)[source]

elliot.utils.read module

Module description:

elliot.utils.read.find_checkpoint(dir, restore_epochs, epochs, rec, best=0)[source]
Parameters
  • dir – directory of the model where we start from the reading.

  • restore_epochs – epoch from which we start from.

  • epochs – epochs from which we restore (0 means that we have best)

  • rec – recommender model

  • best – 0 No Best - 1 Search for the Best

Returns

elliot.utils.read.load_obj(name)[source]

Load the pkl object by name :param name: name of file :return:

elliot.utils.read.read_config(sections_fields)[source]
Parameters

sections_fields (list) – list of fields to retrieve from configuration file

Returns

A list of configuration values.

elliot.utils.read.read_csv(filename)[source]
Parameters

filename (str) – csv file path

Returns

A pandas dataframe.

elliot.utils.read.read_imagenet_classes_txt(filename)[source]
Parameters

filename (str) – txt file path

Returns

A list with 1000 imagenet classes as strings.

elliot.utils.read.read_multi_config()[source]

It reads a config file that contains the configuration parameters for the recommendation systems.

Returns

A list of configuration settings.

elliot.utils.read.read_np(filename)[source]
Parameters

filename (str) – filename of numpy to load

Returns

The loaded numpy.

elliot.utils.write module

Module description:

elliot.utils.write.save_np(npy, filename)[source]

Store numpy to memory. :param npy: numpy to save :param filename: filename :type filename: str

elliot.utils.write.save_obj(obj, name)[source]

Store the object in a pkl file :param obj: python object to be stored :param name: file name (Not insert .pkl) :return:

elliot.utils.write.store_recommendation(recommendations, path='')[source]

Store recommendation list (top-k) :return:

Module contents

Module description: