@@ -55,19 +55,18 @@ class EASEModel(ModelBase[EASEModelConfig]):
5555 regularization : float
5656 The regularization factor of the weights.
5757 num_threads: Optional[int], default ``None``
58- Deprecated. Number of threads used for recommendation ranking on cpu.
58+ Deprecated, use `recommend_n_threads` instead.
59+ Number of threads used for recommendation ranking on cpu.
5960 recommend_n_threads: int, default 0
6061 Number of threads to use for recommendation ranking on cpu.
61- If you want to change ranking behaviour, you can manually assign new value to model
62- `recommend_n_threads` attribute. This should be done before calling model
63- `recommend` method.
62+ If you want to change this parameter after model is initialized,
63+ you can manually assign new value to model `recommend_n_threads` attribute.
6464 recommend_use_gpu_ranking: bool, default ``True``
6565 Flag to use gpu for recommendation ranking. Please note that gpu and cpu ranking may provide
6666 different ordering of items with identical scores in recommendation table.
6767 If ``True``, `implicit.gpu.HAS_CUDA` will also be checked before ranking.
68- If you want to change ranking behaviour, you can manually assign new value to model
69- `recommend_use_gpu_ranking` attribute. This should be done before calling model
70- `recommend` method.
68+ If you want to change this parameter after model is initialized,
69+ you can manually assign new value to model `recommend_use_gpu_ranking` attribute.
7170 verbose : int, default 0
7271 Degree of verbose output. If 0, no output will be provided.
7372 """
@@ -94,7 +93,7 @@ def __init__(
9493 warnings .warn (
9594 """
9695 `num_threads` argument is deprecated and will be removed in future releases.
97- Please use `recommend_n_threads` instead")
96+ Please use `recommend_n_threads` instead.
9897 """
9998 )
10099 recommend_n_threads = num_threads
@@ -155,7 +154,7 @@ def _recommend_u2i(
155154 filter_pairs_csr = ui_csr_for_filter ,
156155 sorted_object_whitelist = sorted_item_ids_to_recommend ,
157156 num_threads = self .recommend_n_threads ,
158- use_gpu = self .recommend_use_gpu_ranking is not False and HAS_CUDA ,
157+ use_gpu = self .recommend_use_gpu_ranking and HAS_CUDA ,
159158 )
160159
161160 return all_user_ids , all_reco_ids , all_scores
0 commit comments