dump module

The dump module defines the dump() function.

surprise.dump.dump(file_name, predictions, trainset=None, algo=None)[source]

Dump a list of predictions for future analysis, using Pickle.

If needed, the trainset object and the algorithm can also be dumped. What is dumped is a dictionnary with keys 'predictions, 'trainset', and 'algo'.

The dumped algorithm won’t be a proper algorithm object but simply a dictionnary with the algorithm attributes as keys-values (technically, the algo.__dict__ attribute).

See User Guide for usage.

Parameters:
  • file_name (str) – The name (with full path) specifying where to dump the predictions.
  • predictions (list of Prediction) – The predictions to dump.
  • trainset (Trainset, optional) – The trainset to dump.
  • algo (Algorithm, optional) – algorithm to dump.