warprec 2.1.9__tar.gz → 2.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (289) hide show
  1. {warprec-2.1.9 → warprec-2.2.0}/PKG-INFO +1 -1
  2. {warprec-2.1.9 → warprec-2.2.0}/pyproject.toml +1 -1
  3. {warprec-2.1.9 → warprec-2.2.0}/warprec/__init__.py +2 -1
  4. {warprec-2.1.9 → warprec-2.2.0}/warprec/common/initialize.py +17 -12
  5. {warprec-2.1.9 → warprec-2.2.0}/warprec/common/run_state.py +3 -2
  6. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/dataset.py +12 -9
  7. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/interactions.py +3 -2
  8. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/knowledge.py +8 -3
  9. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/multimodal.py +3 -2
  10. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/sessions.py +7 -6
  11. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/eval_loaders.py +3 -2
  12. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/filtering.py +24 -23
  13. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/ranking.py +3 -2
  14. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/reader/azureblob_reader.py +5 -4
  15. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/reader/base_reader.py +9 -8
  16. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/reader/local_reader.py +5 -4
  17. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/schema.py +3 -2
  18. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/splitting/splitter.py +5 -4
  19. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/splitting/strategies.py +7 -5
  20. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/stash.py +3 -2
  21. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/writer/base_writer.py +7 -6
  22. warprec-2.2.0/warprec/errors.py +271 -0
  23. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/evaluator.py +5 -4
  24. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/logloss.py +3 -2
  25. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/base_metric.py +3 -2
  26. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/debiased/base.py +3 -2
  27. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/biasdisparitybs.py +3 -2
  28. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/multiobjective/euclideandistance.py +5 -4
  29. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/multiobjective/hypervolume.py +5 -4
  30. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/propensity.py +3 -2
  31. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/common.py +8 -7
  32. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/estimate.py +9 -6
  33. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/eval.py +10 -7
  34. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/base_recommender.py +13 -10
  35. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/cdae.py +6 -3
  36. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/diffrec.py +6 -4
  37. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/dgcf.py +3 -2
  38. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/egcf.py +3 -2
  39. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/gcmc.py +3 -2
  40. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/graph_utils.py +3 -2
  41. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgl.py +3 -2
  42. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknntd.py +4 -3
  43. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/knn/userknntd.py +4 -3
  44. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/neural/twotower.py +3 -2
  45. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/content_based_recommender/vsm.py +2 -1
  46. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/dcnv2.py +3 -2
  47. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/hybrid_recommender/addease.py +2 -1
  48. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/hybrid_recommender/attributeitemknn.py +2 -1
  49. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/hybrid_recommender/attributeuserknn.py +2 -1
  50. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/hybrid_recommender/cease.py +2 -1
  51. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/kahfm.py +5 -4
  52. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/kgat.py +3 -2
  53. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/kgflex.py +5 -4
  54. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/kgin.py +3 -2
  55. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/knowledge_utils.py +3 -2
  56. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/ripplenet.py +3 -2
  57. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/layers.py +5 -4
  58. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/losses.py +3 -2
  59. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/bm3.py +3 -2
  60. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/lattice.py +3 -2
  61. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/mgcn.py +3 -2
  62. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/mmgcn.py +3 -2
  63. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/multimodal_utils.py +6 -5
  64. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/proxy.py +9 -7
  65. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/reranking/base.py +3 -2
  66. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/reranking/calibration.py +9 -5
  67. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/reranking/factory.py +3 -2
  68. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/reranking/mmr.py +5 -2
  69. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/cl4srec.py +2 -1
  70. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/duorec.py +2 -1
  71. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/stan.py +2 -1
  72. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/objectives.py +3 -9
  73. warprec-2.2.0/warprec/run.py +103 -0
  74. {warprec-2.1.9 → warprec-2.2.0}/warprec/serve.py +41 -8
  75. warprec-2.2.0/warprec/serving/errors.py +3 -0
  76. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/servable.py +25 -17
  77. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/common.py +69 -26
  78. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/config.py +74 -43
  79. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/estimate_configuration.py +5 -2
  80. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/evaluation_configuration.py +23 -17
  81. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/general_configuration.py +30 -14
  82. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/model_configuration.py +70 -53
  83. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/reader_configuration.py +11 -10
  84. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/graph_based_config.py +5 -4
  85. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/neural_config.py +10 -9
  86. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/knowledge_aware_config.py +3 -2
  87. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/sequential_model_config.py +37 -36
  88. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/rerank_configuration.py +10 -4
  89. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/run_configuration.py +3 -2
  90. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/serving_configuration.py +31 -23
  91. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/splitter_configuration.py +9 -8
  92. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/training_configuration.py +3 -2
  93. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/writer_configuration.py +3 -2
  94. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/helpers.py +20 -11
  95. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/registry.py +94 -17
  96. warprec-2.1.9/warprec/run.py +0 -69
  97. warprec-2.1.9/warprec/serving/errors.py +0 -27
  98. {warprec-2.1.9 → warprec-2.2.0}/LICENSE +0 -0
  99. {warprec-2.1.9 → warprec-2.2.0}/README.md +0 -0
  100. {warprec-2.1.9 → warprec-2.2.0}/warprec/common/__init__.py +0 -0
  101. {warprec-2.1.9 → warprec-2.2.0}/warprec/common/std_logs.py +0 -0
  102. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/__init__.py +0 -0
  103. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/__init__.py +0 -0
  104. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/common.py +0 -0
  105. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/context.py +0 -0
  106. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/train_structures/__init__.py +0 -0
  107. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/train_structures/custom_collate_fn.py +0 -0
  108. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/train_structures/interaction_structures.py +0 -0
  109. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/train_structures/session_structures.py +0 -0
  110. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/entities/transactions.py +0 -0
  111. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/reader/__init__.py +0 -0
  112. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/splitting/__init__.py +0 -0
  113. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/writer/__init__.py +0 -0
  114. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/writer/azureblob_writer.py +0 -0
  115. {warprec-2.1.9 → warprec-2.2.0}/warprec/data/writer/local_writer.py +0 -0
  116. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/__init__.py +0 -0
  117. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/factory.py +0 -0
  118. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/__init__.py +0 -0
  119. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/__init__.py +0 -0
  120. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/auc.py +0 -0
  121. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/f1.py +0 -0
  122. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/gauc.py +0 -0
  123. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/hit_rate.py +0 -0
  124. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/lauc.py +0 -0
  125. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/map.py +0 -0
  126. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/mar.py +0 -0
  127. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/mrr.py +0 -0
  128. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/ndcg.py +0 -0
  129. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/precision.py +0 -0
  130. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/accuracy/recall.py +0 -0
  131. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/__init__.py +0 -0
  132. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/aclt.py +0 -0
  133. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/aplt.py +0 -0
  134. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/arp.py +0 -0
  135. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/long_tail.py +0 -0
  136. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/pop_reo.py +0 -0
  137. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/bias/pop_rsp.py +0 -0
  138. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/coverage/__init__.py +0 -0
  139. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/coverage/item_coverage.py +0 -0
  140. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/coverage/numretrieved.py +0 -0
  141. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/coverage/user_coverage.py +0 -0
  142. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/coverage/user_coverage_at_n.py +0 -0
  143. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/debiased/__init__.py +0 -0
  144. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/debiased/dcg.py +0 -0
  145. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/debiased/recall.py +0 -0
  146. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/diversity/__init__.py +0 -0
  147. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/diversity/gini_index.py +0 -0
  148. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/diversity/shannon_entropy.py +0 -0
  149. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/diversity/srecall.py +0 -0
  150. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/__init__.py +0 -0
  151. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/biasdisparitybd.py +0 -0
  152. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/biasdisparitybr.py +0 -0
  153. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/itemmadranking.py +0 -0
  154. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/itemmadrating.py +0 -0
  155. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/reo.py +0 -0
  156. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/rsp.py +0 -0
  157. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/usermadranking.py +0 -0
  158. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/fairness/usermadrating.py +0 -0
  159. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/multiobjective/__init__.py +0 -0
  160. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/novelty/__init__.py +0 -0
  161. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/novelty/efd.py +0 -0
  162. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/novelty/epc.py +0 -0
  163. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/novelty/novelty_profile.py +0 -0
  164. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/rating/__init__.py +0 -0
  165. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/rating/mae.py +0 -0
  166. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/rating/mse.py +0 -0
  167. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/metrics/rating/rmse.py +0 -0
  168. {warprec-2.1.9 → warprec-2.2.0}/warprec/evaluation/statistical_significance.py +0 -0
  169. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/__init__.py +0 -0
  170. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/design.py +0 -0
  171. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/remotes/__init__.py +0 -0
  172. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/remotes/data.py +0 -0
  173. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/remotes/ml.py +0 -0
  174. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/swarm.py +0 -0
  175. {warprec-2.1.9 → warprec-2.2.0}/warprec/pipelines/train.py +0 -0
  176. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/__init__.py +0 -0
  177. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/callbacks.py +0 -0
  178. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/__init__.py +0 -0
  179. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/__init__.py +0 -0
  180. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/ease.py +0 -0
  181. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/elsa.py +0 -0
  182. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/macridvae.py +0 -0
  183. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multidae.py +0 -0
  184. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multivae.py +0 -0
  185. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/sansa.py +0 -0
  186. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/__init__.py +0 -0
  187. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/esigcf.py +0 -0
  188. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightccf.py +0 -0
  189. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcl.py +0 -0
  190. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcn.py +0 -0
  191. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcnpp.py +0 -0
  192. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgode.py +0 -0
  193. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/macrgcn.py +0 -0
  194. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/mixrec.py +0 -0
  195. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ngcf.py +0 -0
  196. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/paac.py +0 -0
  197. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/popdcl.py +0 -0
  198. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/recdcl.py +0 -0
  199. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/rp3beta.py +0 -0
  200. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgcl.py +0 -0
  201. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simgcl.py +0 -0
  202. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simrec.py +0 -0
  203. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ultragcn.py +0 -0
  204. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/graph_based/xsimgcl.py +0 -0
  205. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/knn/__init__.py +0 -0
  206. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknn.py +0 -0
  207. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/knn/userknn.py +0 -0
  208. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/__init__.py +0 -0
  209. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/admmslim.py +0 -0
  210. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/bpr.py +0 -0
  211. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/fism.py +0 -0
  212. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials.py +0 -0
  213. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials2008.py +0 -0
  214. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/macrmf.py +0 -0
  215. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/slim.py +0 -0
  216. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/neural/__init__.py +0 -0
  217. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/neural/convncf.py +0 -0
  218. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/collaborative_filtering_recommender/neural/neumf.py +0 -0
  219. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/content_based_recommender/__init__.py +0 -0
  220. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/__init__.py +0 -0
  221. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/afm.py +0 -0
  222. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/dcn.py +0 -0
  223. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/deepfm.py +0 -0
  224. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/fm.py +0 -0
  225. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/nfm.py +0 -0
  226. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/wideanddeep.py +0 -0
  227. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/context_aware_recommender/xdeepfm.py +0 -0
  228. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/hybrid_recommender/__init__.py +0 -0
  229. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/__init__.py +0 -0
  230. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/cke.py +0 -0
  231. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/knowledge_aware_recommender/kgcn.py +0 -0
  232. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/lr_scheduler_wrapper.py +0 -0
  233. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/__init__.py +0 -0
  234. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/freedom.py +0 -0
  235. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/multimodal_recommender/vbpr.py +0 -0
  236. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/optimizer_wrapper.py +0 -0
  237. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/reranking/__init__.py +0 -0
  238. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/__init__.py +0 -0
  239. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/bert4rec.py +0 -0
  240. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/bsarec.py +0 -0
  241. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/caser.py +0 -0
  242. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/core.py +0 -0
  243. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/esasrec.py +0 -0
  244. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/fossil.py +0 -0
  245. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/gru4rec.py +0 -0
  246. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/gsasrec.py +0 -0
  247. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/lightsans.py +0 -0
  248. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/linrec.py +0 -0
  249. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/narm.py +0 -0
  250. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/sequential_recommender/sasrec.py +0 -0
  251. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/similarities.py +0 -0
  252. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/__init__.py +0 -0
  253. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/dashboard_callbacks.py +0 -0
  254. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/logger_callbacks.py +0 -0
  255. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/runtime.py +0 -0
  256. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/scheduler_wrapper.py +0 -0
  257. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/search_algorithm_wrapper.py +0 -0
  258. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/trainer/trainer.py +0 -0
  259. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/unpersonalized_recommender/__init__.py +0 -0
  260. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/unpersonalized_recommender/pop.py +0 -0
  261. {warprec-2.1.9 → warprec-2.2.0}/warprec/recommenders/unpersonalized_recommender/random.py +0 -0
  262. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/__init__.py +0 -0
  263. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/api.py +0 -0
  264. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/app.py +0 -0
  265. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/catalogue.py +0 -0
  266. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/context.py +0 -0
  267. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/deployments.py +0 -0
  268. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/mcp.py +0 -0
  269. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/payload.py +0 -0
  270. {warprec-2.1.9 → warprec-2.2.0}/warprec/serving/schemas.py +0 -0
  271. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/__init__.py +0 -0
  272. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/callback.py +0 -0
  273. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/__init__.py +0 -0
  274. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/dashboard_configuration.py +0 -0
  275. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/__init__.py +0 -0
  276. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/__init__.py +0 -0
  277. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/autoencoder_config.py +0 -0
  278. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/knn_config.py +0 -0
  279. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/latent_factor_config.py +0 -0
  280. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/content_based_config.py +0 -0
  281. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/context_aware_config.py +0 -0
  282. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/hybrid_config.py +0 -0
  283. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/multimodal_config.py +0 -0
  284. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/recommender_model_config/unpersonalized_config.py +0 -0
  285. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/config/search_space_wrapper.py +0 -0
  286. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/enums.py +0 -0
  287. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/logger/__init__.py +0 -0
  288. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/logger/logger.py +0 -0
  289. {warprec-2.1.9 → warprec-2.2.0}/warprec/utils/pause.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: warprec
3
- Version: 2.1.9
3
+ Version: 2.2.0
4
4
  Summary: Unifying Academic Rigor and Industrial Scale for Responsible, Reproducible, and Efficient Recommendation
5
5
  Author: MarcoWV
6
6
  Author-email: marco.avolio@wideverse.com
@@ -61,7 +61,7 @@ warprec = "warprec.run:main"
61
61
  "warprec.serve" = "warprec.serve:main"
62
62
 
63
63
  [tool.poetry]
64
- version = "2.1.9"
64
+ version = "2.2.0"
65
65
 
66
66
  [tool.poetry.dependencies]
67
67
  python = "^3.12"
@@ -1,6 +1,7 @@
1
1
  from . import data
2
+ from . import errors
2
3
  from . import evaluation
3
4
  from . import recommenders
4
5
  from . import utils
5
6
 
6
- __all__ = ["data", "evaluation", "recommenders", "utils"]
7
+ __all__ = ["data", "errors", "evaluation", "recommenders", "utils"]
@@ -3,6 +3,7 @@ from typing import Tuple, List, Optional, Dict, Union, Any
3
3
 
4
4
  from narwhals.dataframe import DataFrame
5
5
 
6
+ from warprec.errors import ConfigurationError, DataError
6
7
  from warprec.data import Dataset
7
8
  from warprec.data.reader import Reader
8
9
  from warprec.data.schema import ColumnLabels, SplitSpec
@@ -66,7 +67,7 @@ def _read_modality(
66
67
  normalisation to apply.
67
68
 
68
69
  Raises:
69
- ValueError: If the file format is not one features can be read from.
70
+ ConfigurationError: If the file format is not one features can be read from.
70
71
  """
71
72
  item_label = modality.item_column_name
72
73
  # The item column has to be read as the interactions read it, or the rows
@@ -105,7 +106,7 @@ def _read_modality(
105
106
  items = frame.select(columns[0]).to_numpy().flatten().tolist()
106
107
  features = frame.select(columns[1:]).to_numpy().astype("float32")
107
108
  case _:
108
- raise ValueError(
109
+ raise ConfigurationError(
109
110
  f"The modality '{name}' is configured as "
110
111
  f"'{modality.file_format}', which features cannot be read from."
111
112
  )
@@ -138,7 +139,7 @@ def initialize_datasets(
138
139
  dataset, an optional validation dataset, and a list of datasets for cross-validation folds.
139
140
 
140
141
  Raises:
141
- ValueError: If the data type specified in the configuration is not supported.
142
+ ConfigurationError: If the data type specified in the configuration is not supported.
142
143
  """
143
144
  # Dataset loading
144
145
  main_dataset: Dataset = None
@@ -174,7 +175,7 @@ def initialize_datasets(
174
175
  case "parquet":
175
176
  data = reader.read_parquet(location)
176
177
  case _:
177
- raise ValueError(f"File format '{file_format}'not supported.")
178
+ raise ConfigurationError(f"File format '{file_format}'not supported.")
178
179
  data = callback.on_data_reading(data)
179
180
 
180
181
  # Check for optional filtering
@@ -207,7 +208,7 @@ def initialize_datasets(
207
208
  )
208
209
 
209
210
  else:
210
- raise ValueError("Data type not yet supported.")
211
+ raise ConfigurationError("Data type not yet supported.")
211
212
 
212
213
  elif config.reader.loading_strategy == "split":
213
214
  if config.reader.data_type == "transaction":
@@ -232,7 +233,9 @@ def initialize_datasets(
232
233
  ext=split.ext,
233
234
  )
234
235
  case _:
235
- raise ValueError(f"File format '{file_format}'not supported.")
236
+ raise ConfigurationError(
237
+ f"File format '{file_format}'not supported."
238
+ )
236
239
 
237
240
  # Filter out train and validation data if not aligned with the training set
238
241
  def _align_set_on_train(
@@ -254,7 +257,7 @@ def initialize_datasets(
254
257
  ),
255
258
  )
256
259
  if len(eval_set) == 0:
257
- raise ValueError(
260
+ raise DataError(
258
261
  "After aligning the split with the training set, it resulted in "
259
262
  "an empty set. Please check the consistency of your splits and "
260
263
  "the filtering process."
@@ -276,7 +279,7 @@ def initialize_datasets(
276
279
  else:
277
280
  val_data = _align_set_on_train(train_data, val_data, "Validation")
278
281
  else:
279
- raise ValueError("Data type not yet supported.")
282
+ raise ConfigurationError("Data type not yet supported.")
280
283
 
281
284
  # Side information reading
282
285
  if config.reader.side:
@@ -304,14 +307,14 @@ def initialize_datasets(
304
307
  location, column_names=side.column_names
305
308
  )
306
309
  case _:
307
- raise ValueError(f"File format '{side_format}' not supported.")
310
+ raise ConfigurationError(f"File format '{side_format}' not supported.")
308
311
 
309
312
  # Knowledge graph reading
310
313
  if config.reader.knowledge:
311
314
  knowledge = config.reader.knowledge
312
315
 
313
316
  if knowledge.file_format != "tabular":
314
- raise ValueError(
317
+ raise ConfigurationError(
315
318
  f"Knowledge graphs are read as tabular files, got "
316
319
  f"'{knowledge.file_format}'."
317
320
  )
@@ -361,7 +364,7 @@ def initialize_datasets(
361
364
  DataFrame[Any]: A DataFrame containing the cluster data.
362
365
 
363
366
  Raises:
364
- ValueError: If the file format is not supported.
367
+ ConfigurationError: If the file format is not supported.
365
368
  """
366
369
 
367
370
  # Define column names
@@ -397,7 +400,9 @@ def initialize_datasets(
397
400
  )
398
401
 
399
402
  case _:
400
- raise ValueError(f"File format '{file_format}'not supported.")
403
+ raise ConfigurationError(
404
+ f"File format '{file_format}'not supported."
405
+ )
401
406
 
402
407
  return cluster_data
403
408
 
@@ -10,6 +10,7 @@ from typing import Any, Dict, Optional, Tuple, TYPE_CHECKING
10
10
  import numpy as np
11
11
  import torch
12
12
 
13
+ from warprec.errors import RunStateError
13
14
  from warprec.utils.logger import logger
14
15
 
15
16
  if TYPE_CHECKING:
@@ -203,11 +204,11 @@ class RunState:
203
204
  RunState: The reconstructed run state.
204
205
 
205
206
  Raises:
206
- ValueError: If the manifest was written by a newer WarpRec version.
207
+ RunStateError: If the manifest was written by a newer WarpRec version.
207
208
  """
208
209
  stored_version = data.get("schema_version", 0)
209
210
  if stored_version > SCHEMA_VERSION:
210
- raise ValueError(
211
+ raise RunStateError(
211
212
  f"Run state schema version {stored_version} is newer than the "
212
213
  "version supported by this WarpRec installation "
213
214
  f"({SCHEMA_VERSION}). Upgrade WarpRec to resume this run."
@@ -13,6 +13,7 @@ import narwhals as nw
13
13
  from narwhals.typing import FrameT
14
14
  from narwhals.dataframe import DataFrame
15
15
 
16
+ from warprec.errors import ConfigurationError, DataError
16
17
  from warprec.data.entities import (
17
18
  Interactions,
18
19
  KnowledgeGraph,
@@ -96,7 +97,7 @@ class Dataset:
96
97
  built only when at least one modality is configured.
97
98
 
98
99
  Raises:
99
- ValueError: If the evaluation_set is not supported.
100
+ ConfigurationError: If the evaluation_set is not supported.
100
101
  """
101
102
 
102
103
  train_set: Interactions = None
@@ -145,7 +146,9 @@ class Dataset:
145
146
  # per structure it derives from them.
146
147
  # Check evaluation set
147
148
  if evaluation_set not in ["Test", "Validation"]:
148
- raise ValueError("Evaluation set must be either 'Test' or 'Validation'.")
149
+ raise ConfigurationError(
150
+ "Evaluation set must be either 'Test' or 'Validation'."
151
+ )
149
152
 
150
153
  # Materialize the data and ensure
151
154
  mat_train_data = self._materialize(train_data)
@@ -714,11 +717,11 @@ class Dataset:
714
717
  Optional[DataFrame[Any]]: The processed DataFrame with integer indices.
715
718
 
716
719
  Raises:
717
- ValueError: If the item ID label is not found in side_data.
720
+ DataError: If the item ID label is not found in side_data.
718
721
  """
719
722
  # Check for item ID label
720
723
  if item_id_label not in side_data.columns:
721
- raise ValueError("Item ID label not found inside side information data.")
724
+ raise DataError("Item ID label not found inside side information data.")
722
725
 
723
726
  df_processed = side_data.clone()
724
727
 
@@ -789,7 +792,7 @@ class Dataset:
789
792
  DataFrame[Any]: The frame with the column replaced by its indices.
790
793
 
791
794
  Raises:
792
- ValueError: If the column was not fitted on the training data first.
795
+ DataError: If the column was not fitted on the training data first.
793
796
  """
794
797
  cells = [
795
798
  "" if value is None else str(value)
@@ -813,7 +816,7 @@ class Dataset:
813
816
 
814
817
  mapping = self._context_maps.get(col)
815
818
  if mapping is None:
816
- raise ValueError(
819
+ raise DataError(
817
820
  f"Mapping for context '{col}' not found. Fit on train first."
818
821
  )
819
822
 
@@ -864,14 +867,14 @@ class Dataset:
864
867
  DataFrame[Any]: The processed data.
865
868
 
866
869
  Raises:
867
- ValueError: If the contextual column names are not
870
+ DataError: If the contextual column names are not
868
871
  present the the DataFrame.
869
872
  """
870
873
  df_processed = df.clone()
871
874
 
872
875
  for col in context_labels:
873
876
  if col not in df_processed.columns:
874
- raise ValueError(f"Context label '{col}' not found in DataFrame.")
877
+ raise DataError(f"Context label '{col}' not found in DataFrame.")
875
878
 
876
879
  separator = self._context_separators.get(col)
877
880
  if separator or self._context_types.get(col) == "seq":
@@ -916,7 +919,7 @@ class Dataset:
916
919
  # Use existing mapping
917
920
  mapping = self._context_maps.get(col)
918
921
  if mapping is None:
919
- raise ValueError(
922
+ raise DataError(
920
923
  f"Mapping for context '{col}' not found. Fit on train first."
921
924
  )
922
925
 
@@ -8,6 +8,7 @@ from torch.utils.data import DataLoader
8
8
  from narwhals.dataframe import DataFrame
9
9
  from scipy.sparse import csr_matrix, coo_matrix
10
10
 
11
+ from warprec.errors import ConfigurationError
11
12
  from warprec.data.entities.train_structures import (
12
13
  InteractionDataset,
13
14
  PointWiseDataset,
@@ -298,11 +299,11 @@ class Interactions:
298
299
  coo_matrix: A sparse matrix of shape [num_users, num_items] for the given rating.
299
300
 
300
301
  Raises:
301
- ValueError: If interactions are not explicit or if
302
+ ConfigurationError: If interactions are not explicit or if
302
303
  rating label is None.
303
304
  """
304
305
  if self.rating_type != RatingType.EXPLICIT or self.rating_label is None:
305
- raise ValueError(
306
+ raise ConfigurationError(
306
307
  "Filtering by rating is only supported for explicit feedback data."
307
308
  )
308
309
 
@@ -5,6 +5,7 @@ import torch
5
5
  from narwhals.dataframe import DataFrame
6
6
  from torch import Tensor
7
7
 
8
+ from warprec.errors import ConfigurationError
8
9
  from warprec.utils.logger import logger
9
10
 
10
11
 
@@ -324,12 +325,16 @@ class KnowledgeGraph:
324
325
  the identifiers the graph was read with.
325
326
 
326
327
  Raises:
327
- ValueError: If the order is not 1 or 2, or min_items is below 1.
328
+ ConfigurationError: If the order is not 1 or 2, or min_items is below 1.
328
329
  """
329
330
  if order not in (1, 2):
330
- raise ValueError(f"An item feature is one or two facts long, not {order}.")
331
+ raise ConfigurationError(
332
+ f"An item feature is one or two facts long, not {order}."
333
+ )
331
334
  if min_items < 1:
332
- raise ValueError(f"min_items must be at least 1, received {min_items}.")
335
+ raise ConfigurationError(
336
+ f"min_items must be at least 1, received {min_items}."
337
+ )
333
338
 
334
339
  key = (order, min_items)
335
340
  if key not in self._item_features:
@@ -4,6 +4,7 @@ import numpy as np
4
4
  import torch
5
5
  from torch import Tensor
6
6
 
7
+ from warprec.errors import DataError
7
8
  from warprec.utils.logger import logger
8
9
 
9
10
 
@@ -87,11 +88,11 @@ class MultiModalFeatures:
87
88
  many items of the catalogue it actually covers.
88
89
 
89
90
  Raises:
90
- ValueError: If the matrix and its row order disagree on how many
91
+ DataError: If the matrix and its row order disagree on how many
91
92
  rows there are.
92
93
  """
93
94
  if len(row_items) != matrix.shape[0]:
94
- raise ValueError(
95
+ raise DataError(
95
96
  f"The features hold {matrix.shape[0]} rows but their row order "
96
97
  f"names {len(row_items)} items. The two files do not describe "
97
98
  "the same modality."
@@ -9,6 +9,7 @@ from torch.utils.data import DataLoader
9
9
  from torch.nn.utils.rnn import pad_sequence
10
10
  from scipy.sparse import csr_matrix
11
11
 
12
+ from warprec.errors import DataError
12
13
  from warprec.data.entities.common import (
13
14
  ITEM_INDEX,
14
15
  USER_INDEX,
@@ -43,9 +44,9 @@ class Sessions:
43
44
  ):
44
45
  # Validation
45
46
  if user_id_label not in data.columns:
46
- raise ValueError(f"User column '{user_id_label}' not found.")
47
+ raise DataError(f"User column '{user_id_label}' not found.")
47
48
  if item_id_label not in data.columns:
48
- raise ValueError(f"Item column '{item_id_label}' not found.")
49
+ raise DataError(f"Item column '{item_id_label}' not found.")
49
50
 
50
51
  # Configuration
51
52
  self._inter_df = data
@@ -180,7 +181,7 @@ class Sessions:
180
181
  kept, because both sequential loaders ask for the same thing.
181
182
 
182
183
  Raises:
183
- ValueError: If no position in the data has a predecessor.
184
+ DataError: If no position in the data has a predecessor.
184
185
  """
185
186
  if self._valid_sample_indices is None:
186
187
  positions = np.arange(len(self._flat_items))
@@ -193,7 +194,7 @@ class Sessions:
193
194
  self._valid_sample_indices = positions[usable]
194
195
 
195
196
  if len(self._valid_sample_indices) == 0:
196
- raise ValueError(
197
+ raise DataError(
197
198
  "No valid sequences found (min 2 interactions per user needed)."
198
199
  )
199
200
 
@@ -280,7 +281,7 @@ class Sessions:
280
281
  valid_users = np.where(user_lens >= 2)[0]
281
282
 
282
283
  if len(valid_users) == 0:
283
- raise ValueError("No valid sliding windows found.")
284
+ raise DataError("No valid sliding windows found.")
284
285
 
285
286
  valid_lens = user_lens[valid_users]
286
287
  valid_starts = self._user_offsets[valid_users]
@@ -351,7 +352,7 @@ class Sessions:
351
352
  valid_users = np.where(user_lens >= 2)[0]
352
353
 
353
354
  if len(valid_users) == 0:
354
- raise ValueError("No valid users with >= 2 interactions found.")
355
+ raise DataError("No valid users with >= 2 interactions found.")
355
356
 
356
357
  # Use the last available window for Cloze task
357
358
  user_starts = self._user_offsets[valid_users]
@@ -10,6 +10,7 @@ from torch.utils.data import Dataset as TorchDataset
10
10
  from torch.nn.utils.rnn import pad_sequence
11
11
  from scipy.sparse import csr_matrix
12
12
 
13
+ from warprec.errors import DataError
13
14
  from warprec.data.entities.context import build_context_array
14
15
  from warprec.data.entities.train_structures.interaction_structures import (
15
16
  popularity_cumulative,
@@ -90,7 +91,7 @@ def draw_negatives(
90
91
  np.ndarray: Exactly num_negatives distinct unseen items, in draw order.
91
92
 
92
93
  Raises:
93
- ValueError: If the user has fewer items left to draw than num_negatives.
94
+ DataError: If the user has fewer items left to draw than num_negatives.
94
95
  """
95
96
  seen = np.unique(np.asarray(seen, dtype=np.int64))
96
97
  if drawable is None:
@@ -104,7 +105,7 @@ def draw_negatives(
104
105
  # cannot line the batch up, and drawing for a user who cannot supply them
105
106
  # would never return.
106
107
  if available < num_negatives:
107
- raise ValueError(
108
+ raise DataError(
108
109
  f"Sampled evaluation asks for {num_negatives} negatives per user, but "
109
110
  f"user {user} has only {available} of the {num_items} items left "
110
111
  f"unseen{reason}. Lower 'evaluation.num_negatives' or evaluate on the "
@@ -8,6 +8,7 @@ import narwhals as nw
8
8
  from narwhals.typing import FrameT
9
9
  from narwhals.dataframe import DataFrame
10
10
 
11
+ from warprec.errors import ConfigurationError, DataError
11
12
  from warprec.utils.logger import logger
12
13
  from warprec.utils.registry import filter_registry
13
14
 
@@ -27,7 +28,7 @@ class Filter(ABC):
27
28
  filter. Any other key is refused.
28
29
 
29
30
  Raises:
30
- ValueError: If a keyword is neither a parameter of the filter nor a
31
+ ConfigurationError: If a keyword is neither a parameter of the filter nor a
31
32
  column label.
32
33
  """
33
34
 
@@ -55,7 +56,7 @@ class Filter(ABC):
55
56
  and param.kind
56
57
  not in (inspect.Parameter.VAR_KEYWORD, inspect.Parameter.VAR_POSITIONAL)
57
58
  ]
58
- raise ValueError(
59
+ raise ConfigurationError(
59
60
  f"The filter {type(self).__name__} does not take "
60
61
  f"{', '.join(repr(key) for key in unknown)}. The parameters it "
61
62
  f"takes are {accepted or 'none'}."
@@ -80,13 +81,13 @@ class MinRating(Filter):
80
81
  **kwargs (Any): Additional keyword arguments.
81
82
 
82
83
  Raises:
83
- ValueError: If the provided argument is invalid.
84
+ ConfigurationError: If the provided argument is invalid.
84
85
  """
85
86
 
86
87
  def __init__(self, min_rating: float, **kwargs: Any):
87
88
  super().__init__(**kwargs)
88
89
  if min_rating <= 0:
89
- raise ValueError("min_rating must be a positive float.")
90
+ raise ConfigurationError("min_rating must be a positive float.")
90
91
  self.min_rating = min_rating
91
92
 
92
93
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -162,13 +163,13 @@ class UserMin(Filter):
162
163
  **kwargs (Any): Additional keyword arguments.
163
164
 
164
165
  Raises:
165
- ValueError: If the provided argument is invalid.
166
+ ConfigurationError: If the provided argument is invalid.
166
167
  """
167
168
 
168
169
  def __init__(self, min_interactions: int, **kwargs: Any):
169
170
  super().__init__(**kwargs)
170
171
  if min_interactions <= 0:
171
- raise ValueError("min_interactions must be a positive integer.")
172
+ raise ConfigurationError("min_interactions must be a positive integer.")
172
173
  self.min_interactions = min_interactions
173
174
 
174
175
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -192,13 +193,13 @@ class UserMax(Filter):
192
193
  **kwargs (Any): Additional keyword arguments.
193
194
 
194
195
  Raises:
195
- ValueError: If the provided argument is invalid.
196
+ ConfigurationError: If the provided argument is invalid.
196
197
  """
197
198
 
198
199
  def __init__(self, max_interactions: int, **kwargs: Any):
199
200
  super().__init__(**kwargs)
200
201
  if max_interactions <= 0:
201
- raise ValueError("max_interactions must be a positive integer.")
202
+ raise ConfigurationError("max_interactions must be a positive integer.")
202
203
  self.max_interactions = max_interactions
203
204
 
204
205
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -222,13 +223,13 @@ class ItemMin(Filter):
222
223
  **kwargs (Any): Additional keyword arguments.
223
224
 
224
225
  Raises:
225
- ValueError: If the provided argument is invalid.
226
+ ConfigurationError: If the provided argument is invalid.
226
227
  """
227
228
 
228
229
  def __init__(self, min_interactions: int, **kwargs: Any):
229
230
  super().__init__(**kwargs)
230
231
  if min_interactions <= 0:
231
- raise ValueError("min_interactions must be a positive integer.")
232
+ raise ConfigurationError("min_interactions must be a positive integer.")
232
233
  self.min_interactions = min_interactions
233
234
 
234
235
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -252,13 +253,13 @@ class ItemMax(Filter):
252
253
  **kwargs (Any): Additional keyword arguments.
253
254
 
254
255
  Raises:
255
- ValueError: If the provided argument is invalid.
256
+ ConfigurationError: If the provided argument is invalid.
256
257
  """
257
258
 
258
259
  def __init__(self, max_interactions: int, **kwargs: Any):
259
260
  super().__init__(**kwargs)
260
261
  if max_interactions <= 0:
261
- raise ValueError("max_interactions must be a positive integer.")
262
+ raise ConfigurationError("max_interactions must be a positive integer.")
262
263
  self.max_interactions = max_interactions
263
264
 
264
265
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -282,13 +283,13 @@ class IterativeKCore(Filter):
282
283
  **kwargs (Any): Additional keyword arguments.
283
284
 
284
285
  Raises:
285
- ValueError: If the provided argument is invalid.
286
+ ConfigurationError: If the provided argument is invalid.
286
287
  """
287
288
 
288
289
  def __init__(self, min_interactions: int, **kwargs: Any):
289
290
  super().__init__(**kwargs)
290
291
  if min_interactions <= 0:
291
- raise ValueError("min_interactions must be a positive integer.")
292
+ raise ConfigurationError("min_interactions must be a positive integer.")
292
293
  self.user_core = UserMin(min_interactions, **kwargs)
293
294
  self.item_core = ItemMin(min_interactions, **kwargs)
294
295
 
@@ -326,15 +327,15 @@ class NRoundsKCore(Filter):
326
327
  **kwargs (Any): Additional keyword arguments.
327
328
 
328
329
  Raises:
329
- ValueError: If the provided argument is invalid.
330
+ ConfigurationError: If the provided argument is invalid.
330
331
  """
331
332
 
332
333
  def __init__(self, rounds: int, min_interactions: int, **kwargs: Any):
333
334
  super().__init__(**kwargs)
334
335
  if rounds <= 0:
335
- raise ValueError("rounds must be a positive integer.")
336
+ raise ConfigurationError("rounds must be a positive integer.")
336
337
  if min_interactions <= 0:
337
- raise ValueError("min_interactions must be a positive integer.")
338
+ raise ConfigurationError("min_interactions must be a positive integer.")
338
339
  self.user_core = UserMin(min_interactions, **kwargs)
339
340
  self.item_core = ItemMin(min_interactions, **kwargs)
340
341
  self.rounds = rounds
@@ -371,13 +372,13 @@ class UserHeadN(Filter):
371
372
  **kwargs (Any): Additional keyword arguments.
372
373
 
373
374
  Raises:
374
- ValueError: If the provided argument is invalid.
375
+ ConfigurationError: If the provided argument is invalid.
375
376
  """
376
377
 
377
378
  def __init__(self, num_interactions: int, **kwargs: Any):
378
379
  super().__init__(**kwargs)
379
380
  if num_interactions <= 0:
380
- raise ValueError("num_interactions must be a positive integer.")
381
+ raise ConfigurationError("num_interactions must be a positive integer.")
381
382
  self.num_interactions = num_interactions
382
383
 
383
384
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -420,13 +421,13 @@ class UserTailN(Filter):
420
421
  **kwargs (Any): Additional keyword arguments.
421
422
 
422
423
  Raises:
423
- ValueError: If the provided argument is invalid.
424
+ ConfigurationError: If the provided argument is invalid.
424
425
  """
425
426
 
426
427
  def __init__(self, num_interactions: int, **kwargs: Any):
427
428
  super().__init__(**kwargs)
428
429
  if num_interactions <= 0:
429
- raise ValueError("num_interactions must be a positive integer.")
430
+ raise ConfigurationError("num_interactions must be a positive integer.")
430
431
  self.num_interactions = num_interactions
431
432
 
432
433
  def __call__(self, dataset: DataFrame[Any]) -> DataFrame[Any]:
@@ -529,7 +530,7 @@ def apply_filtering(data: FrameT, filters: List[Filter]) -> DataFrame[Any]:
529
530
  DataFrame[Any]: The filtered dataset after applying all filters.
530
531
 
531
532
  Raises:
532
- ValueError: If the dataset becomes empty after applying any filter.
533
+ DataError: If the dataset becomes empty after applying any filter.
533
534
  """
534
535
  if isinstance(data, nw.LazyFrame):
535
536
  mat_data = data.collect()
@@ -554,7 +555,7 @@ def apply_filtering(data: FrameT, filters: List[Filter]) -> DataFrame[Any]:
554
555
 
555
556
  # Check if the dataset post filtering is empty
556
557
  if current_len == 0:
557
- raise ValueError(
558
+ raise DataError(
558
559
  f"Dataset is empty after applying filter {i + 1}/{len(filters)}: "
559
560
  f"{single_filter.__class__.__name__}. Please check the filtering criteria."
560
561
  )
@@ -5,6 +5,7 @@ import torch
5
5
  from scipy.sparse import csr_matrix
6
6
  from torch import Tensor
7
7
 
8
+ from warprec.errors import EvaluationError
8
9
  from warprec.data.entities.context import context_key
9
10
  from warprec.utils.logger import logger
10
11
 
@@ -136,13 +137,13 @@ def cold_item_candidates(train_set: csr_matrix, candidates: str) -> Optional[Ten
136
137
  is eligible and there is nothing to restrict.
137
138
 
138
139
  Raises:
139
- ValueError: If the candidate set is not one WarpRec knows.
140
+ EvaluationError: If the candidate set is not one WarpRec knows.
140
141
  """
141
142
  if candidates == "all":
142
143
  return None
143
144
 
144
145
  if candidates not in ("cold", "warm"):
145
- raise ValueError(
146
+ raise EvaluationError(
146
147
  f"Candidate set '{candidates}' is not supported. "
147
148
  "Use 'all', 'cold' or 'warm'."
148
149
  )
@@ -11,6 +11,7 @@ from azure.identity import DefaultAzureCredential
11
11
  from azure.core.exceptions import ResourceNotFoundError
12
12
  from azure.storage.blob import BlobServiceClient
13
13
 
14
+ from warprec.errors import DataNotFoundError
14
15
  from warprec.data.reader.base_reader import Reader
15
16
  from warprec.utils.logger import logger
16
17
 
@@ -145,11 +146,11 @@ class AzureBlobReader(Reader):
145
146
  np.ndarray: The array, two-dimensional and float32.
146
147
 
147
148
  Raises:
148
- FileNotFoundError: If the blob does not exist.
149
+ DataNotFoundError: If the blob does not exist.
149
150
  """
150
151
  content = self._download_blob_content(azure_blob_name, as_bytes=True)
151
152
  if content is None:
152
- raise FileNotFoundError(
153
+ raise DataNotFoundError(
153
154
  f"The feature blob '{azure_blob_name}' does not exist in container "
154
155
  f"'{self.container_name}'."
155
156
  )
@@ -253,13 +254,13 @@ class AzureBlobReader(Reader):
253
254
  dict: A dictionary representing the loaded model state (e.g., weights, hyperparameters).
254
255
 
255
256
  Raises:
256
- FileNotFoundError: If the model state blob is not found.
257
+ DataNotFoundError: If the model state blob is not found.
257
258
  """
258
259
  logger.msg(f"Loading model state from blob: {blob_name}")
259
260
  blob_content_bytes = self._download_blob_content(blob_name, as_bytes=True)
260
261
 
261
262
  if blob_content_bytes is None:
262
- raise FileNotFoundError(
263
+ raise DataNotFoundError(
263
264
  f"Model state blob '{blob_name}' not found in container '{self.container_name}'."
264
265
  )
265
266