warprec 2.2.2__tar.gz → 2.2.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 (290) hide show
  1. {warprec-2.2.2 → warprec-2.2.4}/PKG-INFO +1 -1
  2. {warprec-2.2.2 → warprec-2.2.4}/pyproject.toml +18 -2
  3. {warprec-2.2.2 → warprec-2.2.4}/warprec/common/initialize.py +151 -119
  4. {warprec-2.2.2 → warprec-2.2.4}/warprec/common/run_state.py +7 -9
  5. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/dataset.py +135 -94
  6. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/interactions.py +0 -1
  7. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/knowledge.py +0 -1
  8. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/sessions.py +11 -3
  9. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/train_structures/session_structures.py +1 -3
  10. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/transactions.py +0 -1
  11. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/eval_loaders.py +1 -2
  12. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/filtering.py +62 -42
  13. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/reader/__init__.py +0 -1
  14. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/reader/azureblob_reader.py +0 -1
  15. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/reader/base_reader.py +3 -3
  16. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/splitting/strategies.py +82 -48
  17. warprec-2.2.4/warprec/data/timing.py +129 -0
  18. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/writer/__init__.py +0 -1
  19. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/writer/azureblob_writer.py +1 -2
  20. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/writer/base_writer.py +45 -14
  21. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/writer/local_writer.py +1 -1
  22. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/evaluator.py +2 -4
  23. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/statistical_significance.py +0 -1
  24. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/common.py +51 -6
  25. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/design.py +4 -0
  26. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/estimate.py +30 -17
  27. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/eval.py +5 -1
  28. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/remotes/data.py +11 -4
  29. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/remotes/ml.py +32 -9
  30. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/swarm.py +19 -14
  31. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/train.py +13 -13
  32. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/base_recommender.py +0 -3
  33. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/callbacks.py +102 -7
  34. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/cdae.py +0 -1
  35. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/diffrec.py +0 -2
  36. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/ease.py +0 -1
  37. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/elsa.py +0 -1
  38. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/macridvae.py +0 -1
  39. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multidae.py +0 -1
  40. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multivae.py +0 -1
  41. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/sansa.py +0 -1
  42. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/__init__.py +0 -1
  43. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/dgcf.py +0 -1
  44. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/egcf.py +0 -1
  45. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/esigcf.py +0 -1
  46. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/gcmc.py +0 -1
  47. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/graph_utils.py +1 -1
  48. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightccf.py +0 -1
  49. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcl.py +0 -1
  50. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcn.py +0 -1
  51. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcnpp.py +0 -1
  52. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgode.py +0 -1
  53. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/macrgcn.py +0 -1
  54. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/mixrec.py +0 -1
  55. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ngcf.py +0 -1
  56. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/paac.py +0 -1
  57. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/popdcl.py +0 -1
  58. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/recdcl.py +0 -1
  59. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/rp3beta.py +0 -1
  60. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgcl.py +0 -1
  61. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgl.py +0 -1
  62. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simgcl.py +0 -1
  63. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simrec.py +1 -2
  64. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ultragcn.py +0 -1
  65. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/graph_based/xsimgcl.py +0 -1
  66. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknn.py +0 -1
  67. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknntd.py +0 -1
  68. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/knn/userknn.py +0 -1
  69. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/knn/userknntd.py +0 -1
  70. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/admmslim.py +0 -1
  71. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/bpr.py +0 -1
  72. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/fism.py +0 -1
  73. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials.py +0 -1
  74. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials2008.py +0 -1
  75. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/macrmf.py +0 -1
  76. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/slim.py +0 -1
  77. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/neural/convncf.py +0 -1
  78. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/neural/neumf.py +0 -2
  79. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/neural/twotower.py +0 -1
  80. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/content_based_recommender/vsm.py +0 -1
  81. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/afm.py +0 -1
  82. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/dcn.py +0 -1
  83. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/dcnv2.py +0 -1
  84. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/deepfm.py +1 -3
  85. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/fm.py +0 -1
  86. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/nfm.py +1 -2
  87. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/wideanddeep.py +0 -1
  88. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/xdeepfm.py +0 -2
  89. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/hybrid_recommender/addease.py +0 -1
  90. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/hybrid_recommender/attributeitemknn.py +0 -1
  91. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/hybrid_recommender/attributeuserknn.py +0 -1
  92. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/hybrid_recommender/cease.py +0 -1
  93. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/cke.py +0 -1
  94. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/kahfm.py +0 -2
  95. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/kgat.py +0 -1
  96. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/kgcn.py +0 -1
  97. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/kgflex.py +0 -3
  98. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/kgin.py +0 -2
  99. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/ripplenet.py +0 -3
  100. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/losses.py +1 -1
  101. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/lr_scheduler_wrapper.py +0 -1
  102. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/bm3.py +0 -2
  103. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/freedom.py +0 -2
  104. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/lattice.py +0 -2
  105. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/mgcn.py +0 -2
  106. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/mmgcn.py +0 -3
  107. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/vbpr.py +0 -1
  108. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/optimizer_wrapper.py +0 -1
  109. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/proxy.py +0 -1
  110. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/bert4rec.py +0 -1
  111. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/bsarec.py +0 -1
  112. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/caser.py +0 -1
  113. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/cl4srec.py +0 -1
  114. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/core.py +0 -1
  115. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/duorec.py +0 -1
  116. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/esasrec.py +0 -1
  117. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/fossil.py +0 -1
  118. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/gru4rec.py +0 -1
  119. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/gsasrec.py +0 -1
  120. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/lightsans.py +0 -2
  121. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/linrec.py +0 -1
  122. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/narm.py +0 -1
  123. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/sasrec.py +0 -1
  124. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/stan.py +1 -2
  125. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/similarities.py +0 -1
  126. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/dashboard_callbacks.py +0 -1
  127. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/emissions.py +2 -2
  128. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/logger_callbacks.py +1 -1
  129. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/objectives.py +35 -4
  130. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/scheduler_wrapper.py +1 -2
  131. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/search_algorithm_wrapper.py +0 -1
  132. warprec-2.2.4/warprec/recommenders/trainer/timing.py +579 -0
  133. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/trainer.py +127 -13
  134. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/unpersonalized_recommender/pop.py +0 -1
  135. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/unpersonalized_recommender/random.py +0 -1
  136. {warprec-2.2.2 → warprec-2.2.4}/warprec/serve.py +1 -1
  137. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/api.py +1 -1
  138. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/mcp.py +2 -2
  139. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/payload.py +1 -1
  140. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/servable.py +3 -3
  141. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/config.py +2 -2
  142. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/model_configuration.py +1 -1
  143. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/autoencoder_config.py +0 -1
  144. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/graph_based_config.py +0 -1
  145. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/knn_config.py +0 -1
  146. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/latent_factor_config.py +0 -1
  147. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/neural_config.py +0 -1
  148. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/content_based_config.py +0 -1
  149. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/context_aware_config.py +0 -1
  150. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/hybrid_config.py +0 -1
  151. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/sequential_model_config.py +0 -1
  152. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/unpersonalized_config.py +0 -1
  153. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/search_space_wrapper.py +0 -1
  154. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/splitter_configuration.py +2 -2
  155. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/helpers.py +3 -3
  156. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/pause.py +2 -2
  157. {warprec-2.2.2 → warprec-2.2.4}/LICENSE +0 -0
  158. {warprec-2.2.2 → warprec-2.2.4}/README.md +0 -0
  159. {warprec-2.2.2 → warprec-2.2.4}/warprec/__init__.py +0 -0
  160. {warprec-2.2.2 → warprec-2.2.4}/warprec/common/__init__.py +0 -0
  161. {warprec-2.2.2 → warprec-2.2.4}/warprec/common/std_logs.py +0 -0
  162. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/__init__.py +0 -0
  163. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/__init__.py +0 -0
  164. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/common.py +0 -0
  165. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/context.py +0 -0
  166. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/multimodal.py +0 -0
  167. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/train_structures/__init__.py +0 -0
  168. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/train_structures/custom_collate_fn.py +0 -0
  169. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/entities/train_structures/interaction_structures.py +0 -0
  170. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/ranking.py +0 -0
  171. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/reader/local_reader.py +0 -0
  172. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/schema.py +0 -0
  173. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/splitting/__init__.py +0 -0
  174. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/splitting/splitter.py +0 -0
  175. {warprec-2.2.2 → warprec-2.2.4}/warprec/data/stash.py +0 -0
  176. {warprec-2.2.2 → warprec-2.2.4}/warprec/errors.py +0 -0
  177. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/__init__.py +0 -0
  178. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/factory.py +0 -0
  179. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/__init__.py +0 -0
  180. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/__init__.py +0 -0
  181. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/auc.py +0 -0
  182. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/f1.py +0 -0
  183. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/gauc.py +0 -0
  184. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/hit_rate.py +0 -0
  185. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/lauc.py +0 -0
  186. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/logloss.py +0 -0
  187. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/map.py +0 -0
  188. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/mar.py +0 -0
  189. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/mrr.py +0 -0
  190. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/ndcg.py +0 -0
  191. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/precision.py +0 -0
  192. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/accuracy/recall.py +0 -0
  193. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/base_metric.py +0 -0
  194. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/__init__.py +0 -0
  195. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/aclt.py +0 -0
  196. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/aplt.py +0 -0
  197. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/arp.py +0 -0
  198. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/long_tail.py +0 -0
  199. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/pop_reo.py +0 -0
  200. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/bias/pop_rsp.py +0 -0
  201. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/coverage/__init__.py +0 -0
  202. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/coverage/item_coverage.py +0 -0
  203. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/coverage/numretrieved.py +0 -0
  204. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/coverage/user_coverage.py +0 -0
  205. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/coverage/user_coverage_at_n.py +0 -0
  206. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/debiased/__init__.py +0 -0
  207. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/debiased/base.py +0 -0
  208. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/debiased/dcg.py +0 -0
  209. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/debiased/recall.py +0 -0
  210. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/diversity/__init__.py +0 -0
  211. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/diversity/gini_index.py +0 -0
  212. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/diversity/shannon_entropy.py +0 -0
  213. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/diversity/srecall.py +0 -0
  214. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/__init__.py +0 -0
  215. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/biasdisparitybd.py +0 -0
  216. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/biasdisparitybr.py +0 -0
  217. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/biasdisparitybs.py +0 -0
  218. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/itemmadranking.py +0 -0
  219. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/itemmadrating.py +0 -0
  220. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/reo.py +0 -0
  221. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/rsp.py +0 -0
  222. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/usermadranking.py +0 -0
  223. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/fairness/usermadrating.py +0 -0
  224. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/multiobjective/__init__.py +0 -0
  225. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/multiobjective/euclideandistance.py +0 -0
  226. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/multiobjective/hypervolume.py +0 -0
  227. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/novelty/__init__.py +0 -0
  228. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/novelty/efd.py +0 -0
  229. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/novelty/epc.py +0 -0
  230. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/novelty/novelty_profile.py +0 -0
  231. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/rating/__init__.py +0 -0
  232. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/rating/mae.py +0 -0
  233. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/rating/mse.py +0 -0
  234. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/metrics/rating/rmse.py +0 -0
  235. {warprec-2.2.2 → warprec-2.2.4}/warprec/evaluation/propensity.py +0 -0
  236. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/__init__.py +0 -0
  237. {warprec-2.2.2 → warprec-2.2.4}/warprec/pipelines/remotes/__init__.py +0 -0
  238. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/__init__.py +0 -0
  239. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/__init__.py +0 -0
  240. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/__init__.py +0 -0
  241. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/knn/__init__.py +0 -0
  242. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/__init__.py +0 -0
  243. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/collaborative_filtering_recommender/neural/__init__.py +0 -0
  244. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/content_based_recommender/__init__.py +0 -0
  245. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/context_aware_recommender/__init__.py +0 -0
  246. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/hybrid_recommender/__init__.py +0 -0
  247. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/__init__.py +0 -0
  248. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/knowledge_aware_recommender/knowledge_utils.py +0 -0
  249. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/layers.py +0 -0
  250. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/__init__.py +0 -0
  251. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/multimodal_recommender/multimodal_utils.py +0 -0
  252. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/reranking/__init__.py +0 -0
  253. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/reranking/base.py +0 -0
  254. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/reranking/calibration.py +0 -0
  255. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/reranking/factory.py +0 -0
  256. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/reranking/mmr.py +0 -0
  257. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/sequential_recommender/__init__.py +0 -0
  258. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/__init__.py +0 -0
  259. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/trainer/runtime.py +0 -0
  260. {warprec-2.2.2 → warprec-2.2.4}/warprec/recommenders/unpersonalized_recommender/__init__.py +0 -0
  261. {warprec-2.2.2 → warprec-2.2.4}/warprec/run.py +0 -0
  262. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/__init__.py +0 -0
  263. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/app.py +0 -0
  264. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/catalogue.py +0 -0
  265. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/context.py +0 -0
  266. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/deployments.py +0 -0
  267. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/errors.py +0 -0
  268. {warprec-2.2.2 → warprec-2.2.4}/warprec/serving/schemas.py +0 -0
  269. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/__init__.py +0 -0
  270. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/callback.py +0 -0
  271. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/__init__.py +0 -0
  272. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/common.py +0 -0
  273. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/dashboard_configuration.py +0 -0
  274. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/estimate_configuration.py +0 -0
  275. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/evaluation_configuration.py +0 -0
  276. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/general_configuration.py +0 -0
  277. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/reader_configuration.py +0 -0
  278. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/__init__.py +0 -0
  279. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/__init__.py +0 -0
  280. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/knowledge_aware_config.py +0 -0
  281. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/recommender_model_config/multimodal_config.py +0 -0
  282. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/rerank_configuration.py +0 -0
  283. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/run_configuration.py +0 -0
  284. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/serving_configuration.py +0 -0
  285. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/training_configuration.py +0 -0
  286. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/config/writer_configuration.py +0 -0
  287. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/enums.py +0 -0
  288. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/logger/__init__.py +0 -0
  289. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/logger/logger.py +0 -0
  290. {warprec-2.2.2 → warprec-2.2.4}/warprec/utils/registry.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: warprec
3
- Version: 2.2.2
3
+ Version: 2.2.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
@@ -61,7 +61,7 @@ warprec = "warprec.run:main"
61
61
  "warprec.serve" = "warprec.serve:main"
62
62
 
63
63
  [tool.poetry]
64
- version = "2.2.2"
64
+ version = "2.2.4"
65
65
 
66
66
  [tool.poetry.dependencies]
67
67
  python = "^3.12"
@@ -93,7 +93,6 @@ pytest = "^8.3.4"
93
93
  pytest-cov = "^6.0.0"
94
94
  ruff = "^0.9.3"
95
95
  mypy = "^1.14.1"
96
- pylint = "^3.3.3"
97
96
  bandit = "^1.8.2"
98
97
  nvitop = "^1.4.2"
99
98
  matplotlib = "^3.10.3"
@@ -119,6 +118,23 @@ commit_message = "chore(release): {version} [skip ci]"
119
118
  commit_author = "github-actions [bot] <github-actions[bot]@users.noreply.github.com>"
120
119
 
121
120
 
121
+ [tool.ruff.lint]
122
+ # pylint's errors and warnings, and its size limits, at ruff's speed. pylint
123
+ # itself took over a minute on every push; what it adds beyond these (type
124
+ # inference, duplicate code) is mostly mypy's job.
125
+ extend-select = ["PLE", "PLW", "PLR0911", "PLR0912", "PLR0913", "PLR0915"]
126
+
127
+ [tool.ruff.lint.per-file-ignores]
128
+ # The guides' notebooks are tutorials, not library code
129
+ "*.ipynb" = ["PLW", "PLR"]
130
+
131
+ [tool.ruff.lint.pylint]
132
+ max-args = 10
133
+ max-branches = 12
134
+ max-statements = 50
135
+ max-returns = 6
136
+
137
+
122
138
  [tool.coverage.report]
123
139
  # A floor, not a target, and deliberately well under where the suite actually
124
140
  # sits (80%). A threshold pressed right up against the real number turns every
@@ -1,10 +1,10 @@
1
- # pylint: disable=too-many-branches, too-many-statements
2
1
  from typing import Tuple, List, Optional, Dict, Union, Any
3
2
 
4
3
  from narwhals.dataframe import DataFrame
5
4
 
6
5
  from warprec.errors import ConfigurationError, DataError
7
6
  from warprec.data import Dataset
7
+ from warprec.data.timing import DataPreparationTimes
8
8
  from warprec.data.reader import Reader
9
9
  from warprec.data.schema import ColumnLabels, SplitSpec
10
10
  from warprec.data.splitting import Splitter
@@ -120,10 +120,11 @@ def _read_modality(
120
120
  }
121
121
 
122
122
 
123
- def initialize_datasets(
123
+ def initialize_datasets( # noqa: PLR0912, PLR0915
124
124
  reader: Reader,
125
125
  callback: WarpRecCallback,
126
126
  config: Union[TrainConfiguration, DesignConfiguration, EvalConfiguration],
127
+ timings: Optional[DataPreparationTimes] = None,
127
128
  ) -> Tuple[Dataset, Dataset | None, List[Dataset]]:
128
129
  """Initialize datasets based on the configuration. This is a common operation
129
130
  used in both training and design scripts.
@@ -133,6 +134,9 @@ def initialize_datasets(
133
134
  callback (WarpRecCallback): The callback object for handling events during initialization.
134
135
  config (Union[TrainConfiguration, DesignConfiguration, EvalConfiguration]): The configuration
135
136
  object containing all necessary settings for data loading, filtering, and splitting.
137
+ timings (Optional[DataPreparationTimes]): Where the seconds spent reading,
138
+ filtering, splitting and building each structure of the datasets are
139
+ added, when given. The callback's own time is in none of them.
136
140
 
137
141
  Returns:
138
142
  Tuple[Dataset, Dataset | None, List[Dataset]]: A tuple containing the main
@@ -141,6 +145,8 @@ def initialize_datasets(
141
145
  Raises:
142
146
  ConfigurationError: If the data type specified in the configuration is not supported.
143
147
  """
148
+ times = timings if timings is not None else DataPreparationTimes()
149
+
144
150
  # Dataset loading
145
151
  main_dataset: Dataset = None
146
152
  val_data: List[Tuple[DataFrame[Any], DataFrame[Any]]] | DataFrame[Any] = None
@@ -163,25 +169,29 @@ def initialize_datasets(
163
169
  config, config.reader.local_path, config.reader.azure_blob_name
164
170
  )
165
171
 
166
- match file_format:
167
- case "tabular":
168
- data = reader.read_tabular(
169
- location,
170
- column_names=config.reader.column_names(),
171
- dtypes=config.reader.column_dtype(),
172
- sep=config.reader.sep,
173
- header=config.reader.header,
174
- )
175
- case "parquet":
176
- data = reader.read_parquet(location)
177
- case _:
178
- raise ConfigurationError(f"File format '{file_format}'not supported.")
172
+ with times.measure("reading"):
173
+ match file_format:
174
+ case "tabular":
175
+ data = reader.read_tabular(
176
+ location,
177
+ column_names=config.reader.column_names(),
178
+ dtypes=config.reader.column_dtype(),
179
+ sep=config.reader.sep,
180
+ header=config.reader.header,
181
+ )
182
+ case "parquet":
183
+ data = reader.read_parquet(location)
184
+ case _:
185
+ raise ConfigurationError(
186
+ f"File format '{file_format}'not supported."
187
+ )
179
188
  data = callback.on_data_reading(data)
180
189
 
181
190
  # Check for optional filtering
182
191
  if config.filtering is not None:
183
192
  filters = config.get_filters()
184
- data = apply_filtering(data, filters)
193
+ with times.measure("filtering"):
194
+ data = apply_filtering(data, filters)
185
195
 
186
196
  # Splitter testing
187
197
  if config.splitter:
@@ -193,19 +203,20 @@ def initialize_datasets(
193
203
  )
194
204
 
195
205
  # Compute splitting
196
- train_data, val_data, test_data = splitter.split_transaction(
197
- data,
198
- labels=ColumnLabels(
199
- user_id=config.reader.labels.user_id_label,
200
- item_id=config.reader.labels.item_id_label,
201
- rating=config.reader.labels.rating_label,
202
- timestamp=config.reader.labels.timestamp_label,
203
- ),
204
- test=SplitSpec(**config.splitter.test_splitting.model_dump()),
205
- validation=SplitSpec(
206
- **config.splitter.validation_splitting.model_dump()
207
- ),
208
- )
206
+ with times.measure("splitting"):
207
+ train_data, val_data, test_data = splitter.split_transaction(
208
+ data,
209
+ labels=ColumnLabels(
210
+ user_id=config.reader.labels.user_id_label,
211
+ item_id=config.reader.labels.item_id_label,
212
+ rating=config.reader.labels.rating_label,
213
+ timestamp=config.reader.labels.timestamp_label,
214
+ ),
215
+ test=SplitSpec(**config.splitter.test_splitting.model_dump()),
216
+ validation=SplitSpec(
217
+ **config.splitter.validation_splitting.model_dump()
218
+ ),
219
+ )
209
220
 
210
221
  else:
211
222
  raise ConfigurationError("Data type not yet supported.")
@@ -216,26 +227,27 @@ def initialize_datasets(
216
227
  file_format = split.file_format
217
228
  location = _location(config, split.local_path, split.azure_blob_prefix)
218
229
 
219
- match file_format:
220
- case "tabular":
221
- train_data, val_data, test_data = reader.read_tabular_split(
222
- location,
223
- column_names=config.reader.column_names(),
224
- dtypes=config.reader.column_dtype(),
225
- sep=split.sep,
226
- ext=split.ext,
227
- header=split.header,
228
- )
229
- case "parquet":
230
- train_data, val_data, test_data = reader.read_parquet_split(
231
- location,
232
- column_names=config.reader.column_names(),
233
- ext=split.ext,
234
- )
235
- case _:
236
- raise ConfigurationError(
237
- f"File format '{file_format}'not supported."
238
- )
230
+ with times.measure("reading"):
231
+ match file_format:
232
+ case "tabular":
233
+ train_data, val_data, test_data = reader.read_tabular_split(
234
+ location,
235
+ column_names=config.reader.column_names(),
236
+ dtypes=config.reader.column_dtype(),
237
+ sep=split.sep,
238
+ ext=split.ext,
239
+ header=split.header,
240
+ )
241
+ case "parquet":
242
+ train_data, val_data, test_data = reader.read_parquet_split(
243
+ location,
244
+ column_names=config.reader.column_names(),
245
+ ext=split.ext,
246
+ )
247
+ case _:
248
+ raise ConfigurationError(
249
+ f"File format '{file_format}'not supported."
250
+ )
239
251
 
240
252
  # Filter out train and validation data if not aligned with the training set
241
253
  def _align_set_on_train(
@@ -264,20 +276,23 @@ def initialize_datasets(
264
276
  )
265
277
  return eval_set
266
278
 
267
- test_data = _align_set_on_train(train_data, test_data, "Test")
268
- if val_data is not None:
269
- if isinstance(val_data, list):
270
- # A fold is trained on its own train set, so that is the
271
- # one its validation set has to be aligned with.
272
- val_data = [
273
- (
274
- val_train,
275
- _align_set_on_train(val_train, val_set, "Validation"),
279
+ with times.measure("splitting"):
280
+ test_data = _align_set_on_train(train_data, test_data, "Test")
281
+ if val_data is not None:
282
+ if isinstance(val_data, list):
283
+ # A fold is trained on its own train set, so that is the
284
+ # one its validation set has to be aligned with.
285
+ val_data = [
286
+ (
287
+ val_train,
288
+ _align_set_on_train(val_train, val_set, "Validation"),
289
+ )
290
+ for val_train, val_set in val_data
291
+ ]
292
+ else:
293
+ val_data = _align_set_on_train(
294
+ train_data, val_data, "Validation"
276
295
  )
277
- for val_train, val_set in val_data
278
- ]
279
- else:
280
- val_data = _align_set_on_train(train_data, val_data, "Validation")
281
296
  else:
282
297
  raise ConfigurationError("Data type not yet supported.")
283
298
 
@@ -293,21 +308,24 @@ def initialize_datasets(
293
308
  config.reader.labels.item_id_label: config.reader.dtypes.item_id_type
294
309
  }
295
310
 
296
- match side_format:
297
- case "tabular":
298
- side_data = reader.read_tabular(
299
- location,
300
- column_names=side.column_names,
301
- dtypes=side_dtypes,
302
- sep=side.sep,
303
- header=side.header,
304
- )
305
- case "parquet":
306
- side_data = reader.read_parquet(
307
- location, column_names=side.column_names
308
- )
309
- case _:
310
- raise ConfigurationError(f"File format '{side_format}' not supported.")
311
+ with times.measure("reading"):
312
+ match side_format:
313
+ case "tabular":
314
+ side_data = reader.read_tabular(
315
+ location,
316
+ column_names=side.column_names,
317
+ dtypes=side_dtypes,
318
+ sep=side.sep,
319
+ header=side.header,
320
+ )
321
+ case "parquet":
322
+ side_data = reader.read_parquet(
323
+ location, column_names=side.column_names
324
+ )
325
+ case _:
326
+ raise ConfigurationError(
327
+ f"File format '{side_format}' not supported."
328
+ )
311
329
 
312
330
  # Knowledge graph reading
313
331
  if config.reader.knowledge:
@@ -319,29 +337,33 @@ def initialize_datasets(
319
337
  f"'{knowledge.file_format}'."
320
338
  )
321
339
 
322
- knowledge_data = reader.read_tabular(
323
- _location(config, knowledge.local_path, knowledge.azure_blob_name),
324
- column_names=knowledge.column_names,
325
- sep=knowledge.sep,
326
- header=knowledge.header,
327
- )
340
+ with times.measure("reading"):
341
+ knowledge_data = reader.read_tabular(
342
+ _location(config, knowledge.local_path, knowledge.azure_blob_name),
343
+ column_names=knowledge.column_names,
344
+ sep=knowledge.sep,
345
+ header=knowledge.header,
346
+ )
328
347
 
329
- # The item column has to be read as the interactions read it, or the
330
- # alignment matches nothing and every item silently loses its facts.
331
- knowledge_links = reader.read_tabular(
332
- _location(config, knowledge.link_path, knowledge.link_azure_blob_name),
333
- column_names=knowledge.link_column_names,
334
- dtypes={knowledge.link_column_names[0]: config.reader.dtypes.item_id_type},
335
- sep=knowledge.sep,
336
- header=knowledge.header,
337
- )
348
+ # The item column has to be read as the interactions read it, or the
349
+ # alignment matches nothing and every item silently loses its facts.
350
+ knowledge_links = reader.read_tabular(
351
+ _location(config, knowledge.link_path, knowledge.link_azure_blob_name),
352
+ column_names=knowledge.link_column_names,
353
+ dtypes={
354
+ knowledge.link_column_names[0]: config.reader.dtypes.item_id_type
355
+ },
356
+ sep=knowledge.sep,
357
+ header=knowledge.header,
358
+ )
338
359
 
339
360
  # Multimodal feature reading
340
361
  if config.reader.multimodal:
341
- multimodal_data = {
342
- name: _read_modality(name, modality, reader, config)
343
- for name, modality in config.reader.multimodal.items()
344
- }
362
+ with times.measure("reading"):
363
+ multimodal_data = {
364
+ name: _read_modality(name, modality, reader, config)
365
+ for name, modality in config.reader.multimodal.items()
366
+ }
345
367
 
346
368
  # Cluster information reading
347
369
  if config.reader.clustering:
@@ -440,21 +462,22 @@ def initialize_datasets(
440
462
 
441
463
  # Either file may come alone: only the side that names one is read, and
442
464
  # the dataset leaves the other without clusters.
443
- if user_config["location"]:
444
- user_cluster = _read_cluster_data_clean(
445
- specific_config=user_config,
446
- common_cluster_label=common_cluster_label,
447
- common_cluster_type=common_cluster_type,
448
- reader=reader,
449
- )
465
+ with times.measure("reading"):
466
+ if user_config["location"]:
467
+ user_cluster = _read_cluster_data_clean(
468
+ specific_config=user_config,
469
+ common_cluster_label=common_cluster_label,
470
+ common_cluster_type=common_cluster_type,
471
+ reader=reader,
472
+ )
450
473
 
451
- if item_config["location"]:
452
- item_cluster = _read_cluster_data_clean(
453
- specific_config=item_config,
454
- common_cluster_label=common_cluster_label,
455
- common_cluster_type=common_cluster_type,
456
- reader=reader,
457
- )
474
+ if item_config["location"]:
475
+ item_cluster = _read_cluster_data_clean(
476
+ specific_config=item_config,
477
+ common_cluster_label=common_cluster_label,
478
+ common_cluster_type=common_cluster_type,
479
+ reader=reader,
480
+ )
458
481
 
459
482
  # Dataset common information
460
483
  common_params: Dict[str, Any] = {
@@ -500,6 +523,7 @@ def initialize_datasets(
500
523
  test_data,
501
524
  **common_params,
502
525
  )
526
+ times.add_build_times(main_dataset.get_build_times())
503
527
 
504
528
  # Handle validation data
505
529
  val_dataset: Dataset = None
@@ -514,20 +538,21 @@ def initialize_datasets(
514
538
  evaluation_set="Validation",
515
539
  **common_params,
516
540
  )
541
+ times.add_build_times(val_dataset.get_build_times())
517
542
  else:
518
543
  # CASE 3: Cross-Validation
519
544
  n_folds = len(val_data)
520
545
  for idx, fold in enumerate(val_data):
521
546
  logger.msg(f"Creating fold dataset {idx + 1}/{n_folds}")
522
547
  val_train, val_set = fold
523
- fold_dataset.append(
524
- Dataset(
525
- val_train,
526
- val_set,
527
- evaluation_set="Validation",
528
- **common_params,
529
- )
548
+ fold_set = Dataset(
549
+ val_train,
550
+ val_set,
551
+ evaluation_set="Validation",
552
+ **common_params,
530
553
  )
554
+ times.add_build_times(fold_set.get_build_times())
555
+ fold_dataset.append(fold_set)
531
556
 
532
557
  # Callback on dataset creation
533
558
  callback.on_dataset_creation(
@@ -543,6 +568,7 @@ def dataset_preparation(
543
568
  main_dataset: Dataset,
544
569
  fold_dataset: Optional[List[Dataset]],
545
570
  config: TrainConfiguration,
571
+ timings: Optional[DataPreparationTimes] = None,
546
572
  ):
547
573
  """This method prepares the dataloaders inside the dataset
548
574
  that will be passed to Ray during HPO. It is important to
@@ -554,7 +580,11 @@ def dataset_preparation(
554
580
  fold_dataset (Optional[List[Dataset]]): The list of validation datasets
555
581
  of train/val splits.
556
582
  config (TrainConfiguration): The configuration file used for the experiment.
583
+ timings (Optional[DataPreparationTimes]): Where the seconds spent building
584
+ the evaluation data (the loaders and their candidates) are added, as
585
+ 'evaluation', when given.
557
586
  """
587
+ times = timings if timings is not None else DataPreparationTimes()
558
588
 
559
589
  def prepare_evaluation_loaders(
560
590
  dataset: Dataset, has_classic: bool, has_context: bool
@@ -615,10 +645,12 @@ def dataset_preparation(
615
645
  for model_class in model_classes
616
646
  )
617
647
 
618
- prepare_evaluation_loaders(main_dataset, has_classic, has_context)
648
+ with times.measure("evaluation"):
649
+ prepare_evaluation_loaders(main_dataset, has_classic, has_context)
619
650
  if fold_dataset is not None and isinstance(fold_dataset, list):
620
651
  for i, dataset in enumerate(fold_dataset):
621
652
  logger.msg(
622
653
  f"Preparing fold dataset {i + 1}/{len(fold_dataset)} inner structures for evaluation."
623
654
  )
624
- prepare_evaluation_loaders(dataset, has_classic, has_context)
655
+ with times.measure("evaluation"):
656
+ prepare_evaluation_loaders(dataset, has_classic, has_context)
@@ -391,7 +391,7 @@ class RunStateStore:
391
391
  def __init__(self, writer: "Writer", run_name: str):
392
392
  self._writer = writer
393
393
  self._run_name = run_name
394
- self._root = writer._path_join(writer.experiment_path, "run_state") # pylint: disable=protected-access
394
+ self._root = writer._path_join(writer.experiment_path, "run_state")
395
395
 
396
396
  @property
397
397
  def state_path(self) -> str:
@@ -400,7 +400,7 @@ class RunStateStore:
400
400
  Returns:
401
401
  str: The manifest path.
402
402
  """
403
- return self._writer._path_join(self._root, f"{self._run_name}.json") # pylint: disable=protected-access
403
+ return self._writer._path_join(self._root, f"{self._run_name}.json")
404
404
 
405
405
  def _eval_path(self, model_name: str) -> str:
406
406
  """Returns the path of a model's persisted evaluation results.
@@ -411,7 +411,7 @@ class RunStateStore:
411
411
  Returns:
412
412
  str: The path of the serialized results.
413
413
  """
414
- return self._writer._path_join( # pylint: disable=protected-access
414
+ return self._writer._path_join(
415
415
  self._root, self._run_name, "eval", f"{model_name}.pt"
416
416
  )
417
417
 
@@ -427,7 +427,7 @@ class RunStateStore:
427
427
  Optional[RunState]: The stored state, or None when it is absent or
428
428
  could not be parsed.
429
429
  """
430
- content = self._writer._read_text(self.state_path) # pylint: disable=protected-access
430
+ content = self._writer._read_text(self.state_path)
431
431
  if not content:
432
432
  return None
433
433
  try:
@@ -447,7 +447,7 @@ class RunStateStore:
447
447
  state (RunState): The state to persist.
448
448
  """
449
449
  state.updated_at = datetime.now().isoformat(timespec="seconds")
450
- self._writer._write_text( # pylint: disable=protected-access
450
+ self._writer._write_text(
451
451
  self.state_path,
452
452
  json.dumps(state.to_dict(), indent=4, default=_json_default),
453
453
  )
@@ -467,9 +467,7 @@ class RunStateStore:
467
467
  buffer = BytesIO()
468
468
  torch.save(results, buffer)
469
469
  buffer.seek(0)
470
- self._writer._write_bytes( # pylint: disable=protected-access
471
- self._eval_path(model_name), buffer.read()
472
- )
470
+ self._writer._write_bytes(self._eval_path(model_name), buffer.read())
473
471
  except (OSError, RuntimeError, ValueError) as e:
474
472
  logger.attention(
475
473
  f"Could not persist evaluation results for {model_name}: {e}. "
@@ -487,7 +485,7 @@ class RunStateStore:
487
485
  absent or cannot be read.
488
486
  """
489
487
  try:
490
- content = self._writer._read_bytes(self._eval_path(model_name)) # pylint: disable=protected-access
488
+ content = self._writer._read_bytes(self._eval_path(model_name))
491
489
  except (OSError, RuntimeError) as e:
492
490
  logger.attention(
493
491
  f"Could not read evaluation results for {model_name}: {e}."