warprec 2.1.3__tar.gz → 2.1.4__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 (285) hide show
  1. {warprec-2.1.3 → warprec-2.1.4}/PKG-INFO +7 -2
  2. {warprec-2.1.3 → warprec-2.1.4}/README.md +6 -1
  3. {warprec-2.1.3 → warprec-2.1.4}/pyproject.toml +1 -1
  4. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/statistical_significance.py +78 -39
  5. {warprec-2.1.3 → warprec-2.1.4}/LICENSE +0 -0
  6. {warprec-2.1.3 → warprec-2.1.4}/warprec/__init__.py +0 -0
  7. {warprec-2.1.3 → warprec-2.1.4}/warprec/common/__init__.py +0 -0
  8. {warprec-2.1.3 → warprec-2.1.4}/warprec/common/initialize.py +0 -0
  9. {warprec-2.1.3 → warprec-2.1.4}/warprec/common/run_state.py +0 -0
  10. {warprec-2.1.3 → warprec-2.1.4}/warprec/common/std_logs.py +0 -0
  11. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/__init__.py +0 -0
  12. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/dataset.py +0 -0
  13. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/__init__.py +0 -0
  14. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/common.py +0 -0
  15. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/context.py +0 -0
  16. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/interactions.py +0 -0
  17. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/knowledge.py +0 -0
  18. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/multimodal.py +0 -0
  19. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/sessions.py +0 -0
  20. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/train_structures/__init__.py +0 -0
  21. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/train_structures/custom_collate_fn.py +0 -0
  22. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/train_structures/interaction_structures.py +0 -0
  23. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/train_structures/session_structures.py +0 -0
  24. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/entities/transactions.py +0 -0
  25. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/eval_loaders.py +0 -0
  26. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/filtering.py +0 -0
  27. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/ranking.py +0 -0
  28. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/reader/__init__.py +0 -0
  29. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/reader/azureblob_reader.py +0 -0
  30. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/reader/base_reader.py +0 -0
  31. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/reader/local_reader.py +0 -0
  32. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/schema.py +0 -0
  33. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/splitting/__init__.py +0 -0
  34. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/splitting/splitter.py +0 -0
  35. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/splitting/strategies.py +0 -0
  36. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/writer/__init__.py +0 -0
  37. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/writer/azureblob_writer.py +0 -0
  38. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/writer/base_writer.py +0 -0
  39. {warprec-2.1.3 → warprec-2.1.4}/warprec/data/writer/local_writer.py +0 -0
  40. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/__init__.py +0 -0
  41. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/evaluator.py +0 -0
  42. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/factory.py +0 -0
  43. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/__init__.py +0 -0
  44. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/__init__.py +0 -0
  45. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/auc.py +0 -0
  46. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/f1.py +0 -0
  47. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/gauc.py +0 -0
  48. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/hit_rate.py +0 -0
  49. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/lauc.py +0 -0
  50. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/logloss.py +0 -0
  51. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/map.py +0 -0
  52. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/mar.py +0 -0
  53. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/mrr.py +0 -0
  54. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/ndcg.py +0 -0
  55. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/precision.py +0 -0
  56. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/accuracy/recall.py +0 -0
  57. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/base_metric.py +0 -0
  58. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/__init__.py +0 -0
  59. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/aclt.py +0 -0
  60. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/aplt.py +0 -0
  61. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/arp.py +0 -0
  62. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/long_tail.py +0 -0
  63. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/pop_reo.py +0 -0
  64. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/bias/pop_rsp.py +0 -0
  65. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/coverage/__init__.py +0 -0
  66. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/coverage/item_coverage.py +0 -0
  67. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/coverage/numretrieved.py +0 -0
  68. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/coverage/user_coverage.py +0 -0
  69. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/coverage/user_coverage_at_n.py +0 -0
  70. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/debiased/__init__.py +0 -0
  71. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/debiased/base.py +0 -0
  72. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/debiased/dcg.py +0 -0
  73. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/debiased/recall.py +0 -0
  74. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/diversity/__init__.py +0 -0
  75. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/diversity/gini_index.py +0 -0
  76. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/diversity/shannon_entropy.py +0 -0
  77. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/diversity/srecall.py +0 -0
  78. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/__init__.py +0 -0
  79. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/biasdisparitybd.py +0 -0
  80. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/biasdisparitybr.py +0 -0
  81. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/biasdisparitybs.py +0 -0
  82. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/itemmadranking.py +0 -0
  83. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/itemmadrating.py +0 -0
  84. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/reo.py +0 -0
  85. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/rsp.py +0 -0
  86. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/usermadranking.py +0 -0
  87. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/fairness/usermadrating.py +0 -0
  88. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/multiobjective/__init__.py +0 -0
  89. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/multiobjective/euclideandistance.py +0 -0
  90. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/multiobjective/hypervolume.py +0 -0
  91. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/novelty/__init__.py +0 -0
  92. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/novelty/efd.py +0 -0
  93. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/novelty/epc.py +0 -0
  94. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/novelty/novelty_profile.py +0 -0
  95. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/rating/__init__.py +0 -0
  96. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/rating/mae.py +0 -0
  97. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/rating/mse.py +0 -0
  98. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/metrics/rating/rmse.py +0 -0
  99. {warprec-2.1.3 → warprec-2.1.4}/warprec/evaluation/propensity.py +0 -0
  100. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/__init__.py +0 -0
  101. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/common.py +0 -0
  102. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/design.py +0 -0
  103. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/estimate.py +0 -0
  104. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/eval.py +0 -0
  105. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/remotes/__init__.py +0 -0
  106. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/remotes/data.py +0 -0
  107. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/remotes/ml.py +0 -0
  108. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/swarm.py +0 -0
  109. {warprec-2.1.3 → warprec-2.1.4}/warprec/pipelines/train.py +0 -0
  110. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/__init__.py +0 -0
  111. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/base_recommender.py +0 -0
  112. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/callbacks.py +0 -0
  113. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/__init__.py +0 -0
  114. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/__init__.py +0 -0
  115. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/cdae.py +0 -0
  116. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/diffrec.py +0 -0
  117. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/ease.py +0 -0
  118. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/elsa.py +0 -0
  119. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/macridvae.py +0 -0
  120. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multidae.py +0 -0
  121. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multivae.py +0 -0
  122. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/sansa.py +0 -0
  123. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/__init__.py +0 -0
  124. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/dgcf.py +0 -0
  125. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/egcf.py +0 -0
  126. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/esigcf.py +0 -0
  127. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/gcmc.py +0 -0
  128. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/graph_utils.py +0 -0
  129. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightccf.py +0 -0
  130. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcl.py +0 -0
  131. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcn.py +0 -0
  132. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcnpp.py +0 -0
  133. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgode.py +0 -0
  134. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/macrgcn.py +0 -0
  135. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/mixrec.py +0 -0
  136. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ngcf.py +0 -0
  137. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/paac.py +0 -0
  138. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/popdcl.py +0 -0
  139. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/recdcl.py +0 -0
  140. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/rp3beta.py +0 -0
  141. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgcl.py +0 -0
  142. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgl.py +0 -0
  143. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simgcl.py +0 -0
  144. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simrec.py +0 -0
  145. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ultragcn.py +0 -0
  146. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/xsimgcl.py +0 -0
  147. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/knn/__init__.py +0 -0
  148. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknn.py +0 -0
  149. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknntd.py +0 -0
  150. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/knn/userknn.py +0 -0
  151. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/knn/userknntd.py +0 -0
  152. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/__init__.py +0 -0
  153. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/admmslim.py +0 -0
  154. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/bpr.py +0 -0
  155. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/fism.py +0 -0
  156. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials.py +0 -0
  157. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials2008.py +0 -0
  158. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/macrmf.py +0 -0
  159. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/slim.py +0 -0
  160. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/neural/__init__.py +0 -0
  161. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/neural/convncf.py +0 -0
  162. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/neural/neumf.py +0 -0
  163. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/collaborative_filtering_recommender/neural/twotower.py +0 -0
  164. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/content_based_recommender/__init__.py +0 -0
  165. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/content_based_recommender/vsm.py +0 -0
  166. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/__init__.py +0 -0
  167. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/afm.py +0 -0
  168. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/dcn.py +0 -0
  169. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/dcnv2.py +0 -0
  170. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/deepfm.py +0 -0
  171. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/fm.py +0 -0
  172. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/nfm.py +0 -0
  173. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/wideanddeep.py +0 -0
  174. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/context_aware_recommender/xdeepfm.py +0 -0
  175. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/hybrid_recommender/__init__.py +0 -0
  176. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/hybrid_recommender/addease.py +0 -0
  177. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/hybrid_recommender/attributeitemknn.py +0 -0
  178. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/hybrid_recommender/attributeuserknn.py +0 -0
  179. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/hybrid_recommender/cease.py +0 -0
  180. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/__init__.py +0 -0
  181. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/cke.py +0 -0
  182. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/kahfm.py +0 -0
  183. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/kgat.py +0 -0
  184. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/kgcn.py +0 -0
  185. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/kgflex.py +0 -0
  186. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/kgin.py +0 -0
  187. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/knowledge_utils.py +0 -0
  188. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/knowledge_aware_recommender/ripplenet.py +0 -0
  189. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/layers.py +0 -0
  190. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/losses.py +0 -0
  191. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/lr_scheduler_wrapper.py +0 -0
  192. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/__init__.py +0 -0
  193. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/bm3.py +0 -0
  194. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/freedom.py +0 -0
  195. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/lattice.py +0 -0
  196. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/mgcn.py +0 -0
  197. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/mmgcn.py +0 -0
  198. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/multimodal_utils.py +0 -0
  199. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/multimodal_recommender/vbpr.py +0 -0
  200. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/optimizer_wrapper.py +0 -0
  201. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/proxy.py +0 -0
  202. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/reranking/__init__.py +0 -0
  203. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/reranking/base.py +0 -0
  204. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/reranking/calibration.py +0 -0
  205. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/reranking/factory.py +0 -0
  206. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/reranking/mmr.py +0 -0
  207. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/__init__.py +0 -0
  208. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/bert4rec.py +0 -0
  209. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/bsarec.py +0 -0
  210. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/caser.py +0 -0
  211. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/cl4srec.py +0 -0
  212. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/core.py +0 -0
  213. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/duorec.py +0 -0
  214. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/esasrec.py +0 -0
  215. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/fossil.py +0 -0
  216. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/gru4rec.py +0 -0
  217. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/gsasrec.py +0 -0
  218. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/lightsans.py +0 -0
  219. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/linrec.py +0 -0
  220. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/narm.py +0 -0
  221. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/sasrec.py +0 -0
  222. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/sequential_recommender/stan.py +0 -0
  223. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/similarities.py +0 -0
  224. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/__init__.py +0 -0
  225. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/dashboard_callbacks.py +0 -0
  226. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/logger_callbacks.py +0 -0
  227. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/objectives.py +0 -0
  228. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/runtime.py +0 -0
  229. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/scheduler_wrapper.py +0 -0
  230. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/search_algorithm_wrapper.py +0 -0
  231. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/trainer/trainer.py +0 -0
  232. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/unpersonalized_recommender/__init__.py +0 -0
  233. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/unpersonalized_recommender/pop.py +0 -0
  234. {warprec-2.1.3 → warprec-2.1.4}/warprec/recommenders/unpersonalized_recommender/random.py +0 -0
  235. {warprec-2.1.3 → warprec-2.1.4}/warprec/run.py +0 -0
  236. {warprec-2.1.3 → warprec-2.1.4}/warprec/serve.py +0 -0
  237. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/__init__.py +0 -0
  238. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/api.py +0 -0
  239. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/app.py +0 -0
  240. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/catalogue.py +0 -0
  241. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/context.py +0 -0
  242. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/deployments.py +0 -0
  243. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/errors.py +0 -0
  244. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/mcp.py +0 -0
  245. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/payload.py +0 -0
  246. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/schemas.py +0 -0
  247. {warprec-2.1.3 → warprec-2.1.4}/warprec/serving/servable.py +0 -0
  248. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/__init__.py +0 -0
  249. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/callback.py +0 -0
  250. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/__init__.py +0 -0
  251. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/common.py +0 -0
  252. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/config.py +0 -0
  253. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/dashboard_configuration.py +0 -0
  254. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/estimate_configuration.py +0 -0
  255. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/evaluation_configuration.py +0 -0
  256. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/general_configuration.py +0 -0
  257. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/model_configuration.py +0 -0
  258. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/reader_configuration.py +0 -0
  259. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/__init__.py +0 -0
  260. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/__init__.py +0 -0
  261. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/autoencoder_config.py +0 -0
  262. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/graph_based_config.py +0 -0
  263. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/knn_config.py +0 -0
  264. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/latent_factor_config.py +0 -0
  265. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/neural_config.py +0 -0
  266. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/content_based_config.py +0 -0
  267. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/context_aware_config.py +0 -0
  268. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/hybrid_config.py +0 -0
  269. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/knowledge_aware_config.py +0 -0
  270. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/multimodal_config.py +0 -0
  271. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/sequential_model_config.py +0 -0
  272. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/recommender_model_config/unpersonalized_config.py +0 -0
  273. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/rerank_configuration.py +0 -0
  274. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/run_configuration.py +0 -0
  275. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/search_space_wrapper.py +0 -0
  276. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/serving_configuration.py +0 -0
  277. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/splitter_configuration.py +0 -0
  278. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/training_configuration.py +0 -0
  279. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/config/writer_configuration.py +0 -0
  280. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/enums.py +0 -0
  281. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/helpers.py +0 -0
  282. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/logger/__init__.py +0 -0
  283. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/logger/logger.py +0 -0
  284. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/pause.py +0 -0
  285. {warprec-2.1.3 → warprec-2.1.4}/warprec/utils/registry.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: warprec
3
- Version: 2.1.3
3
+ Version: 2.1.4
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
@@ -112,6 +112,7 @@ An **Application Layer** serves trained models on Ray Serve, as a batched REST A
112
112
  - [🔍 Evaluate a model](#-evaluate-a-model)
113
113
  - [🛰️ Serve a model](#️-serve-a-model)
114
114
  - [🧰 Makefile Commands](#-makefile-commands)
115
+ - [📓 Guides](#-guides)
115
116
  - [🤝 Contributing](#-contributing)
116
117
  - [📜 License](#-license)
117
118
  - [📖 Citation](#-citation)
@@ -129,7 +130,7 @@ An **Application Layer** serves trained models on Ray Serve, as a batched REST A
129
130
  - **Green AI & Carbon Tracking**: WarpRec is the first recommendation framework with native [CodeCarbon](https://codecarbon.io/) integration, automatically quantifying energy consumption and CO₂ emissions for every experiment and persisting carbon footprint reports alongside standard results.
130
131
  - **Agentic AI via MCP**: Served models can also be exposed as [Model Context Protocol](https://modelcontextprotocol.io/) tools on the same server (`server.mcp: true`), so LLMs and autonomous agents call a trained recommender as a tool — transforming the framework from a static predictor into an interactive, agent-ready component.
131
132
  - **Model Serving on Ray Serve**: A model saved by the training pipeline is served with `python -m warprec.serve -c serve.yml` — a batched REST API with replicas, autoscaling and GPU placement set in configuration, and exportable to a Ray cluster or KubeRay. General, sequential, graph and context-aware models are all served from the checkpoint alone.
132
- - **Experiment Tracking**: Native integrations with `TensorBoard`, `Weights & Biases`, and `MLflow` for real-time monitoring of metrics, training dynamics, and multi-run management.
133
+ - **Experiment Tracking**: Native integrations with `Weights & Biases` and `MLflow` for real-time monitoring of metrics, training dynamics and multi-run management, and `CodeCarbon` for the energy and emissions of every trial.
133
134
  - **Custom Pipelines & Callbacks**: Alongside the standard Training, Design, Evaluation, Swarm, and Estimate workflows, WarpRec exposes an event-driven Callback system for injecting custom logic at any stage — enabling complex experiments without modifying framework internals.
134
135
 
135
136
  ## ⚙️ Installation
@@ -299,6 +300,10 @@ The project includes a Makefile to simplify common operations:
299
300
  make test
300
301
  ```
301
302
 
303
+ ## 📓 Guides
304
+
305
+ The [`guides/`](guides/) folder holds 17 Jupyter notebooks, committed with their outputs, that go through WarpRec one piece at a time on public datasets: reading, filtering and splitting data, side information, contexts, knowledge graphs and multimodal features, every dataloader, the model families, hyperparameter search, every metric family, cold start and debiased evaluation, custom models and metrics, callbacks, and serving. Each step runs through the Python API and through the configuration that does the same, so the notebooks double as worked examples of both. See [`guides/README.md`](guides/README.md) or the [Guides](https://warprec.readthedocs.io/en/latest/guides/) section of the documentation.
306
+
302
307
  ## 🤝 Contributing
303
308
  We welcome contributions from the community! Whether you're fixing bugs, improving documentation, or proposing new features, your input is highly valued.
304
309
 
@@ -52,6 +52,7 @@ An **Application Layer** serves trained models on Ray Serve, as a batched REST A
52
52
  - [🔍 Evaluate a model](#-evaluate-a-model)
53
53
  - [🛰️ Serve a model](#️-serve-a-model)
54
54
  - [🧰 Makefile Commands](#-makefile-commands)
55
+ - [📓 Guides](#-guides)
55
56
  - [🤝 Contributing](#-contributing)
56
57
  - [📜 License](#-license)
57
58
  - [📖 Citation](#-citation)
@@ -69,7 +70,7 @@ An **Application Layer** serves trained models on Ray Serve, as a batched REST A
69
70
  - **Green AI & Carbon Tracking**: WarpRec is the first recommendation framework with native [CodeCarbon](https://codecarbon.io/) integration, automatically quantifying energy consumption and CO₂ emissions for every experiment and persisting carbon footprint reports alongside standard results.
70
71
  - **Agentic AI via MCP**: Served models can also be exposed as [Model Context Protocol](https://modelcontextprotocol.io/) tools on the same server (`server.mcp: true`), so LLMs and autonomous agents call a trained recommender as a tool — transforming the framework from a static predictor into an interactive, agent-ready component.
71
72
  - **Model Serving on Ray Serve**: A model saved by the training pipeline is served with `python -m warprec.serve -c serve.yml` — a batched REST API with replicas, autoscaling and GPU placement set in configuration, and exportable to a Ray cluster or KubeRay. General, sequential, graph and context-aware models are all served from the checkpoint alone.
72
- - **Experiment Tracking**: Native integrations with `TensorBoard`, `Weights & Biases`, and `MLflow` for real-time monitoring of metrics, training dynamics, and multi-run management.
73
+ - **Experiment Tracking**: Native integrations with `Weights & Biases` and `MLflow` for real-time monitoring of metrics, training dynamics and multi-run management, and `CodeCarbon` for the energy and emissions of every trial.
73
74
  - **Custom Pipelines & Callbacks**: Alongside the standard Training, Design, Evaluation, Swarm, and Estimate workflows, WarpRec exposes an event-driven Callback system for injecting custom logic at any stage — enabling complex experiments without modifying framework internals.
74
75
 
75
76
  ## ⚙️ Installation
@@ -239,6 +240,10 @@ The project includes a Makefile to simplify common operations:
239
240
  make test
240
241
  ```
241
242
 
243
+ ## 📓 Guides
244
+
245
+ The [`guides/`](guides/) folder holds 17 Jupyter notebooks, committed with their outputs, that go through WarpRec one piece at a time on public datasets: reading, filtering and splitting data, side information, contexts, knowledge graphs and multimodal features, every dataloader, the model families, hyperparameter search, every metric family, cold start and debiased evaluation, custom models and metrics, callbacks, and serving. Each step runs through the Python API and through the configuration that does the same, so the notebooks double as worked examples of both. See [`guides/README.md`](guides/README.md) or the [Guides](https://warprec.readthedocs.io/en/latest/guides/) section of the documentation.
246
+
242
247
  ## 🤝 Contributing
243
248
  We welcome contributions from the community! Whether you're fixing bugs, improving documentation, or proposing new features, your input is highly valued.
244
249
 
@@ -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.3"
64
+ version = "2.1.4"
65
65
 
66
66
  [tool.poetry.dependencies]
67
67
  python = "^3.12"
@@ -12,12 +12,24 @@ from scipy.stats import wilcoxon, ttest_rel, kruskal, mannwhitneyu
12
12
  from warprec.utils.registry import stat_significance_registry
13
13
  from warprec.utils.logger import logger
14
14
 
15
+ # What a significance column says about the difference between two models
16
+ SIGNIFICANT = "Significant"
17
+ NOT_SIGNIFICANT = "Not significant"
18
+
15
19
 
16
20
  class StatisticalTest(ABC):
17
21
  """Abstract base class for statistical tests.
18
22
  This class defines the interface for statistical tests to be implemented.
23
+
24
+ Attributes:
25
+ PAIRED (bool): Whether the test uses the pairing of the two samples. Two
26
+ models are scored on the same users, so a paired test compares each
27
+ user with themself; an unpaired one treats the two sets of per-user
28
+ scores as independent samples, and asks a weaker question.
19
29
  """
20
30
 
31
+ PAIRED: bool = True
32
+
21
33
  @abstractmethod
22
34
  def compute(self, X: np.ndarray, Y: Optional[np.ndarray]) -> Tuple[float, float]:
23
35
  """Compute the statistical test.
@@ -81,9 +93,13 @@ class PairedTTest(StatisticalTest):
81
93
  @stat_significance_registry.register("kruskal_test")
82
94
  class KruskalTest(StatisticalTest):
83
95
  """Kruskal-Wallis H test implementation.
84
- This class implements the Kruskal-Wallis H test for independent samples.
96
+ This class implements the Kruskal-Wallis H test for independent samples. It
97
+ ignores that two models are scored on the same users; the Wilcoxon
98
+ signed-rank test is its paired counterpart.
85
99
  """
86
100
 
101
+ PAIRED = False
102
+
87
103
  def compute(
88
104
  self, X: np.ndarray, Y: Optional[np.ndarray] = None
89
105
  ) -> Tuple[float, float]:
@@ -103,9 +119,13 @@ class KruskalTest(StatisticalTest):
103
119
  @stat_significance_registry.register("whitney_u_test")
104
120
  class WhitneyUTest(StatisticalTest):
105
121
  """Mann-Whitney U test implementation.
106
- This class implements the Mann-Whitney U test for independent samples.
122
+ This class implements the Mann-Whitney U test for independent samples. It
123
+ ignores that two models are scored on the same users; the Wilcoxon
124
+ signed-rank test is its paired counterpart.
107
125
  """
108
126
 
127
+ PAIRED = False
128
+
109
129
  def compute(
110
130
  self, X: np.ndarray, Y: Optional[np.ndarray] = None
111
131
  ) -> Tuple[float, float]:
@@ -139,8 +159,8 @@ def apply_bonferroni_correction(
139
159
 
140
160
  return results.with_columns(
141
161
  nw.when(nw.col("p-value") < corrected_alpha)
142
- .then(nw.lit("Accepted"))
143
- .otherwise(nw.lit("Rejected"))
162
+ .then(nw.lit(SIGNIFICANT))
163
+ .otherwise(nw.lit(NOT_SIGNIFICANT))
144
164
  .alias(f"Significance (Bonferroni α={corrected_alpha:.2e})")
145
165
  )
146
166
 
@@ -150,6 +170,8 @@ def apply_holm_bonferroni_correction(
150
170
  ) -> DataFrame[Any]:
151
171
  """Apply Holm-Bonferroni correction to p-values in the results DataFrame.
152
172
 
173
+ The table is returned sorted by p-value.
174
+
153
175
  Args:
154
176
  results (DataFrame[Any]): The DataFrame containing p-values.
155
177
  alpha (float): The significance level for the correction.
@@ -157,26 +179,15 @@ def apply_holm_bonferroni_correction(
157
179
  Returns:
158
180
  DataFrame[Any]: The DataFrame with corrected significance values.
159
181
  """
182
+ # Holm's step-down procedure: with the p-values sorted, the i-th smallest
183
+ # of m is tested against alpha / (m - i + 1), and testing stops at the first
184
+ # that fails. Every hypothesis from there on is kept, whatever its p-value.
160
185
  results = results.sort("p-value")
161
-
162
- # Create a rank column (1-based)
163
- # We use 'ordinal' rank to get a simple 1..N sequence matching the sort
164
- results = results.with_columns(
165
- nw.col("p-value").rank(method="ordinal").alias("Holm-Bonferroni Rank")
166
- )
167
-
168
- # Apply logic
169
- results = results.with_columns(
170
- nw.when(
171
- nw.col("p-value")
172
- < (alpha / (nw.len() - nw.col("Holm-Bonferroni Rank") + 1))
173
- )
174
- .then(nw.lit("Accepted"))
175
- .otherwise(nw.lit("Rejected"))
176
- .alias("Significance (Holm-Bonferroni)")
177
- )
178
-
179
- return results.drop("Holm-Bonferroni Rank")
186
+ p_values = results["p-value"].to_numpy()
187
+ m = len(p_values)
188
+ passes = p_values < alpha / (m - np.arange(m))
189
+ rejected = np.logical_and.accumulate(passes) if m else passes
190
+ return _with_verdicts(results, rejected, "Significance (Holm-Bonferroni)")
180
191
 
181
192
 
182
193
  def apply_fdr_correction(
@@ -184,6 +195,8 @@ def apply_fdr_correction(
184
195
  ) -> DataFrame[Any]:
185
196
  """Apply False Discovery Rate (FDR) correction to p-values in the results DataFrame.
186
197
 
198
+ The Benjamini-Hochberg procedure. The table is returned sorted by p-value.
199
+
187
200
  Args:
188
201
  results (DataFrame[Any]): The DataFrame containing p-values.
189
202
  alpha (float): The significance level for the correction.
@@ -191,26 +204,51 @@ def apply_fdr_correction(
191
204
  Returns:
192
205
  DataFrame[Any]: The DataFrame with corrected significance values.
193
206
  """
207
+ # Benjamini-Hochberg's step-up procedure: with the p-values sorted, find the
208
+ # largest rank k whose p-value is below k * alpha / m, and reject every
209
+ # hypothesis up to it, including those that missed their own threshold.
194
210
  results = results.sort("p-value")
211
+ p_values = results["p-value"].to_numpy()
212
+ m = len(p_values)
213
+ passing = np.flatnonzero(p_values < alpha * np.arange(1, m + 1) / m)
214
+ rejected = np.arange(m) <= passing[-1] if passing.size else np.zeros(m, bool)
215
+ return _with_verdicts(results, rejected, "Significance (FDR)")
195
216
 
196
- results = results.with_columns(
197
- nw.col("p-value").rank(method="ordinal").alias("FDR Rank")
198
- )
199
217
 
200
- # Calculate Threshold
201
- # Threshold = (Rank / Total) * Alpha
202
- results = results.with_columns(
203
- (alpha * nw.col("FDR Rank") / nw.len()).alias("FDR Threshold")
204
- )
218
+ def _with_verdicts(
219
+ results: DataFrame[Any], rejected: np.ndarray, column: str
220
+ ) -> DataFrame[Any]:
221
+ """Add one verdict per row of a table already in the order of the decisions.
222
+
223
+ Args:
224
+ results (DataFrame[Any]): The table, sorted as the decisions are.
225
+ rejected (np.ndarray): Whether each row's null hypothesis is rejected.
226
+ column (str): The name of the verdict column.
205
227
 
206
- results = results.with_columns(
207
- nw.when(nw.col("p-value") < nw.col("FDR Threshold"))
208
- .then(nw.lit("Accepted"))
209
- .otherwise(nw.lit("Rejected"))
210
- .alias("Significance (FDR)")
228
+ Returns:
229
+ DataFrame[Any]: The table with the verdict column added.
230
+ """
231
+ verdicts = np.where(rejected, SIGNIFICANT, NOT_SIGNIFICANT).tolist()
232
+ return results.with_columns(
233
+ nw.new_series(
234
+ column, verdicts, nw.String, backend=nw.get_native_namespace(results)
235
+ )
211
236
  )
212
237
 
213
- return results.drop(["FDR Rank", "FDR Threshold"])
238
+
239
+ def _note_unpaired(test_name: str, stat_test: StatisticalTest) -> None:
240
+ """Say so when a test ignores that both models are scored on the same users.
241
+
242
+ Args:
243
+ test_name (str): The registered name of the test.
244
+ stat_test (StatisticalTest): The test about to be run.
245
+ """
246
+ if not stat_test.PAIRED:
247
+ logger.attention(
248
+ f"{test_name} treats the two models' per-user scores as independent "
249
+ "samples, although both are scored on the same users. The Wilcoxon "
250
+ "signed-rank test and the paired t-test use that pairing."
251
+ )
214
252
 
215
253
 
216
254
  def compute_paired_statistical_test(
@@ -249,6 +287,7 @@ def compute_paired_statistical_test(
249
287
  rows = []
250
288
  model_names = list(results.keys())
251
289
  stat_test: StatisticalTest = stat_significance_registry.get(test_name)
290
+ _note_unpaired(test_name, stat_test)
252
291
  cutoff_values: Set[int] = set()
253
292
 
254
293
  # Gather all cutoff values
@@ -293,7 +332,7 @@ def compute_paired_statistical_test(
293
332
  continue
294
333
 
295
334
  stat, p = stat_test.compute(array_a, array_b)
296
- accepted = "Accepted" if p < alpha else "Rejected"
335
+ verdict = SIGNIFICANT if p < alpha else NOT_SIGNIFICANT
297
336
 
298
337
  rows.append(
299
338
  {
@@ -303,7 +342,7 @@ def compute_paired_statistical_test(
303
342
  "Cutoff": cutoff,
304
343
  "Statistic": stat,
305
344
  "p-value": p,
306
- f"Significance (α={alpha})": accepted,
345
+ f"Significance (α={alpha})": verdict,
307
346
  }
308
347
  )
309
348
  except (KeyError, ValueError, AttributeError) as e:
File without changes
File without changes
File without changes
File without changes
File without changes