warprec 2.2.3__tar.gz → 2.2.5__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.
- {warprec-2.2.3 → warprec-2.2.5}/PKG-INFO +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/pyproject.toml +18 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/common/initialize.py +151 -119
- {warprec-2.2.3 → warprec-2.2.5}/warprec/common/run_state.py +11 -9
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/dataset.py +135 -94
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/interactions.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/knowledge.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/sessions.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/train_structures/session_structures.py +1 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/transactions.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/eval_loaders.py +1 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/filtering.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/reader/__init__.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/reader/azureblob_reader.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/reader/base_reader.py +3 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/splitting/strategies.py +0 -1
- warprec-2.2.5/warprec/data/timing.py +129 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/writer/__init__.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/writer/azureblob_writer.py +1 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/writer/base_writer.py +2 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/writer/local_writer.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/evaluator.py +2 -4
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/statistical_significance.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/common.py +42 -8
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/design.py +4 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/estimate.py +11 -11
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/eval.py +5 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/remotes/data.py +11 -4
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/swarm.py +120 -46
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/train.py +148 -84
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/base_recommender.py +39 -4
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/callbacks.py +102 -7
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/cdae.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/diffrec.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/ease.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/elsa.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/macridvae.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multidae.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/multivae.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/sansa.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/__init__.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/dgcf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/egcf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/esigcf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/gcmc.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/graph_utils.py +7 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightccf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgcnpp.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/lightgode.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/macrgcn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/mixrec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ngcf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/paac.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/popdcl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/recdcl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/rp3beta.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgcl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/sgl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simgcl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/simrec.py +1 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/ultragcn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/graph_based/xsimgcl.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/knn/itemknntd.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/knn/userknn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/knn/userknntd.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/admmslim.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/bpr.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/fism.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/ials2008.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/macrmf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/slim.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/neural/convncf.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/neural/neumf.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/neural/twotower.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/content_based_recommender/vsm.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/afm.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/dcn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/dcnv2.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/deepfm.py +1 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/fm.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/nfm.py +1 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/wideanddeep.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/xdeepfm.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/hybrid_recommender/addease.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/hybrid_recommender/attributeitemknn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/hybrid_recommender/attributeuserknn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/hybrid_recommender/cease.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/cke.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/kahfm.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/kgat.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/kgcn.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/kgflex.py +0 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/kgin.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/ripplenet.py +0 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/losses.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/lr_scheduler_wrapper.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/bm3.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/freedom.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/lattice.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/mgcn.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/mmgcn.py +0 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/vbpr.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/optimizer_wrapper.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/proxy.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/bert4rec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/bsarec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/caser.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/cl4srec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/core.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/duorec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/esasrec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/fossil.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/gru4rec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/gsasrec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/lightsans.py +0 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/linrec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/narm.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/sasrec.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/stan.py +1 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/similarities.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/dashboard_callbacks.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/emissions.py +2 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/logger_callbacks.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/objectives.py +36 -14
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/scheduler_wrapper.py +1 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/search_algorithm_wrapper.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/timing.py +119 -22
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/trainer.py +122 -43
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/unpersonalized_recommender/pop.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/unpersonalized_recommender/random.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serve.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/api.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/mcp.py +2 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/payload.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/servable.py +3 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/config.py +2 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/model_configuration.py +1 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/autoencoder_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/graph_based_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/knn_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/latent_factor_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/neural_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/content_based_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/context_aware_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/hybrid_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/sequential_model_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/unpersonalized_config.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/search_space_wrapper.py +0 -1
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/splitter_configuration.py +2 -2
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/helpers.py +3 -3
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/pause.py +2 -2
- {warprec-2.2.3 → warprec-2.2.5}/LICENSE +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/README.md +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/common/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/common/std_logs.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/common.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/context.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/multimodal.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/train_structures/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/train_structures/custom_collate_fn.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/entities/train_structures/interaction_structures.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/ranking.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/reader/local_reader.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/schema.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/splitting/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/splitting/splitter.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/data/stash.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/errors.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/factory.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/auc.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/f1.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/gauc.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/hit_rate.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/lauc.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/logloss.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/map.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/mar.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/mrr.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/ndcg.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/precision.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/accuracy/recall.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/base_metric.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/aclt.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/aplt.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/arp.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/long_tail.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/pop_reo.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/bias/pop_rsp.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/coverage/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/coverage/item_coverage.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/coverage/numretrieved.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/coverage/user_coverage.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/coverage/user_coverage_at_n.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/debiased/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/debiased/base.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/debiased/dcg.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/debiased/recall.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/diversity/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/diversity/gini_index.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/diversity/shannon_entropy.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/diversity/srecall.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/biasdisparitybd.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/biasdisparitybr.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/biasdisparitybs.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/itemmadranking.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/itemmadrating.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/reo.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/rsp.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/usermadranking.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/fairness/usermadrating.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/multiobjective/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/multiobjective/euclideandistance.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/multiobjective/hypervolume.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/novelty/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/novelty/efd.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/novelty/epc.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/novelty/novelty_profile.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/rating/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/rating/mae.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/rating/mse.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/metrics/rating/rmse.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/evaluation/propensity.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/remotes/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/pipelines/remotes/ml.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/autoencoder/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/knn/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/latent_factor/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/collaborative_filtering_recommender/neural/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/content_based_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/context_aware_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/hybrid_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/knowledge_aware_recommender/knowledge_utils.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/layers.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/multimodal_recommender/multimodal_utils.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/reranking/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/reranking/base.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/reranking/calibration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/reranking/factory.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/reranking/mmr.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/sequential_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/trainer/runtime.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/recommenders/unpersonalized_recommender/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/run.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/app.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/catalogue.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/context.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/deployments.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/errors.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/serving/schemas.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/callback.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/common.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/dashboard_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/estimate_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/evaluation_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/general_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/reader_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/collaborative_filtering_config/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/knowledge_aware_config.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/recommender_model_config/multimodal_config.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/rerank_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/run_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/serving_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/training_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/config/writer_configuration.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/enums.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/logger/__init__.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/logger/logger.py +0 -0
- {warprec-2.2.3 → warprec-2.2.5}/warprec/utils/registry.py +0 -0
|
@@ -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.
|
|
64
|
+
version = "2.2.5"
|
|
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
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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
|
-
|
|
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
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
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
|
-
|
|
268
|
-
|
|
269
|
-
if
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
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
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
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
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
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
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
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
|
-
|
|
342
|
-
|
|
343
|
-
|
|
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
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
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
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
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
|
-
|
|
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
|
-
|
|
655
|
+
with times.measure("evaluation"):
|
|
656
|
+
prepare_evaluation_loaders(dataset, has_classic, has_context)
|
|
@@ -60,6 +60,9 @@ class ModelStatus(str, Enum):
|
|
|
60
60
|
that follow it did not all complete.
|
|
61
61
|
- COMPLETED: Every stage for this model finished and was written.
|
|
62
62
|
- FAILED: Hyperparameter optimization produced no usable model.
|
|
63
|
+
- FAILED_LOAD: Hyperparameter optimization finished, but its best model
|
|
64
|
+
could not be built from the result. Resuming the run tries again
|
|
65
|
+
without repeating the search.
|
|
63
66
|
"""
|
|
64
67
|
|
|
65
68
|
PENDING = "pending"
|
|
@@ -67,6 +70,7 @@ class ModelStatus(str, Enum):
|
|
|
67
70
|
HPO_COMPLETED = "hpo_completed"
|
|
68
71
|
COMPLETED = "completed"
|
|
69
72
|
FAILED = "failed"
|
|
73
|
+
FAILED_LOAD = "failed_load"
|
|
70
74
|
|
|
71
75
|
|
|
72
76
|
@dataclass
|
|
@@ -391,7 +395,7 @@ class RunStateStore:
|
|
|
391
395
|
def __init__(self, writer: "Writer", run_name: str):
|
|
392
396
|
self._writer = writer
|
|
393
397
|
self._run_name = run_name
|
|
394
|
-
self._root = writer._path_join(writer.experiment_path, "run_state")
|
|
398
|
+
self._root = writer._path_join(writer.experiment_path, "run_state")
|
|
395
399
|
|
|
396
400
|
@property
|
|
397
401
|
def state_path(self) -> str:
|
|
@@ -400,7 +404,7 @@ class RunStateStore:
|
|
|
400
404
|
Returns:
|
|
401
405
|
str: The manifest path.
|
|
402
406
|
"""
|
|
403
|
-
return self._writer._path_join(self._root, f"{self._run_name}.json")
|
|
407
|
+
return self._writer._path_join(self._root, f"{self._run_name}.json")
|
|
404
408
|
|
|
405
409
|
def _eval_path(self, model_name: str) -> str:
|
|
406
410
|
"""Returns the path of a model's persisted evaluation results.
|
|
@@ -411,7 +415,7 @@ class RunStateStore:
|
|
|
411
415
|
Returns:
|
|
412
416
|
str: The path of the serialized results.
|
|
413
417
|
"""
|
|
414
|
-
return self._writer._path_join(
|
|
418
|
+
return self._writer._path_join(
|
|
415
419
|
self._root, self._run_name, "eval", f"{model_name}.pt"
|
|
416
420
|
)
|
|
417
421
|
|
|
@@ -427,7 +431,7 @@ class RunStateStore:
|
|
|
427
431
|
Optional[RunState]: The stored state, or None when it is absent or
|
|
428
432
|
could not be parsed.
|
|
429
433
|
"""
|
|
430
|
-
content = self._writer._read_text(self.state_path)
|
|
434
|
+
content = self._writer._read_text(self.state_path)
|
|
431
435
|
if not content:
|
|
432
436
|
return None
|
|
433
437
|
try:
|
|
@@ -447,7 +451,7 @@ class RunStateStore:
|
|
|
447
451
|
state (RunState): The state to persist.
|
|
448
452
|
"""
|
|
449
453
|
state.updated_at = datetime.now().isoformat(timespec="seconds")
|
|
450
|
-
self._writer._write_text(
|
|
454
|
+
self._writer._write_text(
|
|
451
455
|
self.state_path,
|
|
452
456
|
json.dumps(state.to_dict(), indent=4, default=_json_default),
|
|
453
457
|
)
|
|
@@ -467,9 +471,7 @@ class RunStateStore:
|
|
|
467
471
|
buffer = BytesIO()
|
|
468
472
|
torch.save(results, buffer)
|
|
469
473
|
buffer.seek(0)
|
|
470
|
-
self._writer._write_bytes(
|
|
471
|
-
self._eval_path(model_name), buffer.read()
|
|
472
|
-
)
|
|
474
|
+
self._writer._write_bytes(self._eval_path(model_name), buffer.read())
|
|
473
475
|
except (OSError, RuntimeError, ValueError) as e:
|
|
474
476
|
logger.attention(
|
|
475
477
|
f"Could not persist evaluation results for {model_name}: {e}. "
|
|
@@ -487,7 +489,7 @@ class RunStateStore:
|
|
|
487
489
|
absent or cannot be read.
|
|
488
490
|
"""
|
|
489
491
|
try:
|
|
490
|
-
content = self._writer._read_bytes(self._eval_path(model_name))
|
|
492
|
+
content = self._writer._read_bytes(self._eval_path(model_name))
|
|
491
493
|
except (OSError, RuntimeError) as e:
|
|
492
494
|
logger.attention(
|
|
493
495
|
f"Could not read evaluation results for {model_name}: {e}."
|