ImplicitALSWrapperModel
- class rectools.models.implicit_als.ImplicitALSWrapperModel(model: Union[AlternatingLeastSquares, AlternatingLeastSquares], verbose: int = 0, fit_features_together: bool = False)[source]
Bases:
VectorModel[ImplicitALSWrapperModelConfig]Wrapper for implicit.als.AlternatingLeastSquares with possibility to use explicit features and GPU support.
See https://implicit.readthedocs.io/en/latest/als.html for details of base model.
- Parameters
model (AnyAlternatingLeastSquares) – Base model that will be used.
verbose (int, default 0) – Degree of verbose output. If 0, no output will be provided.
fit_features_together (bool, default False) – Whether fit explicit features together with latent features or not. Used only if explicit features are present in dataset. See documentations linked above for details.
- 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.
Return user and item vector representations from fitted model.
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
i2i_distn_threadsrecommends_for_coldrecommends_for_warmu2i_dist- config_class
alias of
ImplicitALSWrapperModelConfig