EASEModel

class rectools.models.ease.EASEModel(regularization: float = 500.0, num_threads: Optional[int] = None, recommend_n_threads: int = 0, recommend_use_gpu_ranking: bool = True, verbose: int = 0)[source]

Bases: ModelBase[EASEModelConfig]

Embarrassingly Shallow Autoencoders for Sparse Data model.

See https://arxiv.org/abs/1905.03375.

Please note that this algorithm requires a lot of RAM during fit method. Out-of-memory issues are possible for big datasets. Reasonable catalog size for local development is about 30k items. Reasonable amount of interactions is about 20m.

Parameters
  • regularization (float) – The regularization factor of the weights.

  • num_threads (Optional[int], default None) – Deprecated, use recommend_n_threads instead. Number of threads used for recommendation ranking on CPU.

  • recommend_n_threads (int, default 0) – Number of threads to use for recommendation ranking on CPU. Specifying 0 means to default to the number of cores on the machine. If you want to change this parameter after model is initialized, you can manually assign new value to model recommend_n_threads attribute.

  • recommend_use_gpu_ranking (bool, default True) – Flag to use GPU for recommendation ranking. Please note that GPU and CPU ranking may provide different ordering of items with identical scores in recommendation table. If True, implicit.gpu.HAS_CUDA will also be checked before ranking. If you want to change this parameter after model is initialized, you can manually assign new value to model recommend_use_gpu_ranking attribute.

  • verbose (int, default 0) – Degree of verbose output. If 0, no output will be provided.

Inherited-members

Methods

dumps()

Serialize model to bytes.

fit(dataset, *args, **kwargs)

Fit model.

fit_partial(dataset, *args, **kwargs)

Fit model.

from_config(config)

Create model from config.

get_config([mode, simple_types])

Return model config.

get_params([simple_types, sep])

Return model parameters.

load(f)

Load model from file.

loads(data)

Load model from bytes.

recommend(users, dataset, k, filter_viewed)

Recommend items for users.

recommend_to_items(target_items, dataset, k)

Recommend items for target items.

save(f)

Save model to file.

Attributes

recommends_for_cold

recommends_for_warm

config_class

alias of EASEModelConfig