RecTools icon indicating copy to clipboard operation
RecTools copied to clipboard

Save/load functions to all of the models

Open blondered opened this issue 2 years ago • 2 comments

Feature Description

Support for saving and loading models in appropriate formats

Why this feature?

It' just super helpful in many cases

Additional context

No response

blondered avatar Feb 21 '24 14:02 blondered

We plan to:

  1. Use numpy npz format for all applicalbe models for saving sparse and dense matrixes
  2. Use https://numpy.org/doc/stable/reference/generated/numpy.savez_compressed.html or https://numpy.org/doc/stable/reference/generated/numpy.savez.html methods. @feldlime needs to research and confirm
  3. Model params are need to be acquired from get_params model method and saved in json format
  4. Models that don't have matrixes after fitting need their fitted data to be converted to np.array and then saved in npz. Example: popular model
  5. Torch models need to use torch native formats. This is not our priority for now

We need to (these are blockers):

  1. Implement get_params method for all models (https://github.com/MobileTeleSystems/RecTools/issues/108)
  2. Initialise models from dict of params (including wrapped model params). Implement a separate method for that. Interface needs to be discussed (https://github.com/MobileTeleSystems/RecTools/issues/157)

blondered avatar Jul 10 '24 07:07 blondered

When saving model fitted data and models params we need to create an archive to make it one file. @feldlime creates full description for this task

blondered avatar Jul 10 '24 08:07 blondered