replay-rec 0.17.1rc0__py3-none-any.whl → 0.18.0__py3-none-any.whl
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.
- replay/__init__.py +2 -1
- replay/data/dataset.py +3 -2
- replay/data/dataset_utils/dataset_label_encoder.py +1 -0
- replay/data/nn/schema.py +5 -5
- replay/metrics/__init__.py +1 -0
- replay/models/als.py +1 -1
- replay/models/base_rec.py +7 -7
- replay/models/extensions/ann/index_inferers/nmslib_filter_index_inferer.py +3 -3
- replay/models/extensions/ann/index_inferers/nmslib_index_inferer.py +3 -3
- replay/models/nn/sequential/bert4rec/model.py +5 -112
- replay/models/nn/sequential/sasrec/model.py +8 -5
- replay/optimization/optuna_objective.py +1 -0
- replay/preprocessing/converter.py +1 -1
- replay/preprocessing/filters.py +19 -18
- replay/preprocessing/history_based_fp.py +5 -5
- replay/preprocessing/label_encoder.py +1 -0
- replay/scenarios/__init__.py +1 -0
- replay/splitters/last_n_splitter.py +1 -1
- replay/splitters/time_splitter.py +1 -1
- replay/splitters/two_stage_splitter.py +8 -6
- replay/utils/distributions.py +1 -0
- replay/utils/session_handler.py +3 -3
- replay/utils/spark_utils.py +2 -2
- {replay_rec-0.17.1rc0.dist-info → replay_rec-0.18.0.dist-info}/METADATA +12 -18
- {replay_rec-0.17.1rc0.dist-info → replay_rec-0.18.0.dist-info}/RECORD +27 -80
- {replay_rec-0.17.1rc0.dist-info → replay_rec-0.18.0.dist-info}/WHEEL +1 -1
- replay/experimental/__init__.py +0 -0
- replay/experimental/metrics/__init__.py +0 -61
- replay/experimental/metrics/base_metric.py +0 -601
- replay/experimental/metrics/coverage.py +0 -97
- replay/experimental/metrics/experiment.py +0 -175
- replay/experimental/metrics/hitrate.py +0 -26
- replay/experimental/metrics/map.py +0 -30
- replay/experimental/metrics/mrr.py +0 -18
- replay/experimental/metrics/ncis_precision.py +0 -31
- replay/experimental/metrics/ndcg.py +0 -49
- replay/experimental/metrics/precision.py +0 -22
- replay/experimental/metrics/recall.py +0 -25
- replay/experimental/metrics/rocauc.py +0 -49
- replay/experimental/metrics/surprisal.py +0 -90
- replay/experimental/metrics/unexpectedness.py +0 -76
- replay/experimental/models/__init__.py +0 -10
- replay/experimental/models/admm_slim.py +0 -205
- replay/experimental/models/base_neighbour_rec.py +0 -204
- replay/experimental/models/base_rec.py +0 -1271
- replay/experimental/models/base_torch_rec.py +0 -234
- replay/experimental/models/cql.py +0 -452
- replay/experimental/models/ddpg.py +0 -921
- replay/experimental/models/dt4rec/__init__.py +0 -0
- replay/experimental/models/dt4rec/dt4rec.py +0 -189
- replay/experimental/models/dt4rec/gpt1.py +0 -401
- replay/experimental/models/dt4rec/trainer.py +0 -127
- replay/experimental/models/dt4rec/utils.py +0 -265
- replay/experimental/models/extensions/spark_custom_models/__init__.py +0 -0
- replay/experimental/models/extensions/spark_custom_models/als_extension.py +0 -792
- replay/experimental/models/implicit_wrap.py +0 -131
- replay/experimental/models/lightfm_wrap.py +0 -302
- replay/experimental/models/mult_vae.py +0 -331
- replay/experimental/models/neuromf.py +0 -405
- replay/experimental/models/scala_als.py +0 -296
- replay/experimental/nn/data/__init__.py +0 -1
- replay/experimental/nn/data/schema_builder.py +0 -55
- replay/experimental/preprocessing/__init__.py +0 -3
- replay/experimental/preprocessing/data_preparator.py +0 -838
- replay/experimental/preprocessing/padder.py +0 -229
- replay/experimental/preprocessing/sequence_generator.py +0 -208
- replay/experimental/scenarios/__init__.py +0 -1
- replay/experimental/scenarios/obp_wrapper/__init__.py +0 -8
- replay/experimental/scenarios/obp_wrapper/obp_optuna_objective.py +0 -74
- replay/experimental/scenarios/obp_wrapper/replay_offline.py +0 -248
- replay/experimental/scenarios/obp_wrapper/utils.py +0 -87
- replay/experimental/scenarios/two_stages/__init__.py +0 -0
- replay/experimental/scenarios/two_stages/reranker.py +0 -117
- replay/experimental/scenarios/two_stages/two_stages_scenario.py +0 -757
- replay/experimental/utils/__init__.py +0 -0
- replay/experimental/utils/logger.py +0 -24
- replay/experimental/utils/model_handler.py +0 -181
- replay/experimental/utils/session_handler.py +0 -44
- replay_rec-0.17.1rc0.dist-info/NOTICE +0 -41
- {replay_rec-0.17.1rc0.dist-info → replay_rec-0.18.0.dist-info}/LICENSE +0 -0
replay/utils/session_handler.py
CHANGED
|
@@ -48,10 +48,10 @@ def get_spark_session(
|
|
|
48
48
|
path_to_replay_jar = (
|
|
49
49
|
"https://repo1.maven.org/maven2/io/github/sb-ai-lab/replay_2.12/3.1.3/replay_2.12-3.1.3.jar"
|
|
50
50
|
)
|
|
51
|
-
elif pyspark_version.startswith(("3.2", "3.3")):
|
|
51
|
+
elif pyspark_version.startswith(("3.2", "3.3")): # pragma: no cover
|
|
52
52
|
path_to_replay_jar = "https://repo1.maven.org/maven2/io/github/sb-ai-lab/replay_2.12/3.2.0_als_metrics/replay_2.12-3.2.0_als_metrics.jar"
|
|
53
53
|
elif pyspark_version.startswith("3.4"): # pragma: no cover
|
|
54
|
-
path_to_replay_jar = "https://repo1.maven.org/maven2/io/github/sb-ai-lab/
|
|
54
|
+
path_to_replay_jar = "https://repo1.maven.org/maven2/io/github/sb-ai-lab/replay_after_fix_2.12/0.1/replay_after_fix_2.12-0.1.jar"
|
|
55
55
|
else: # pragma: no cover
|
|
56
56
|
path_to_replay_jar = (
|
|
57
57
|
"https://repo1.maven.org/maven2/io/github/sb-ai-lab/replay_2.12/3.1.3/replay_2.12-3.1.3.jar"
|
|
@@ -83,7 +83,7 @@ def get_spark_session(
|
|
|
83
83
|
.config("spark.driver.maxResultSize", "4g")
|
|
84
84
|
.config("spark.driver.bindAddress", "127.0.0.1")
|
|
85
85
|
.config("spark.driver.host", "localhost")
|
|
86
|
-
.config("spark.sql.execution.arrow.
|
|
86
|
+
.config("spark.sql.execution.arrow.enabled", "true")
|
|
87
87
|
.config("spark.kryoserializer.buffer.max", "256m")
|
|
88
88
|
.config("spark.files.overwrite", "true")
|
|
89
89
|
.master(f"local[{'*' if core_count == -1 else core_count}]")
|
replay/utils/spark_utils.py
CHANGED
|
@@ -459,8 +459,8 @@ def fallback(
|
|
|
459
459
|
if base.count() == 0:
|
|
460
460
|
return get_top_k_recs(fill, k, query_column=query_column, rating_column=rating_column)
|
|
461
461
|
margin = 0.1
|
|
462
|
-
min_in_base = base.agg({rating_column: "min"}).
|
|
463
|
-
max_in_fill = fill.agg({rating_column: "max"}).
|
|
462
|
+
min_in_base = base.agg({rating_column: "min"}).first()[0]
|
|
463
|
+
max_in_fill = fill.agg({rating_column: "max"}).first()[0]
|
|
464
464
|
diff = max_in_fill - min_in_base
|
|
465
465
|
fill = fill.withColumnRenamed(rating_column, "relevance_fallback")
|
|
466
466
|
if diff >= 0:
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: replay-rec
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.18.0
|
|
4
4
|
Summary: RecSys Library
|
|
5
5
|
Home-page: https://sb-ai-lab.github.io/RePlay/
|
|
6
6
|
License: Apache-2.0
|
|
7
7
|
Author: AI Lab
|
|
8
|
-
Requires-Python: >=3.8.1,<3.
|
|
8
|
+
Requires-Python: >=3.8.1,<3.12
|
|
9
9
|
Classifier: Development Status :: 4 - Beta
|
|
10
10
|
Classifier: Environment :: Console
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
@@ -16,32 +16,26 @@ Classifier: Operating System :: Unix
|
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
20
|
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
20
21
|
Provides-Extra: all
|
|
21
22
|
Provides-Extra: spark
|
|
22
23
|
Provides-Extra: torch
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist: implicit (>=0.7.0,<0.8.0)
|
|
27
|
-
Requires-Dist: lightautoml (>=0.3.1,<0.4.0)
|
|
28
|
-
Requires-Dist: lightfm (==1.17)
|
|
29
|
-
Requires-Dist: lightning (>=2.0.2,<3.0.0) ; extra == "torch" or extra == "all"
|
|
30
|
-
Requires-Dist: llvmlite (>=0.32.1)
|
|
31
|
-
Requires-Dist: nmslib (==2.1.1)
|
|
32
|
-
Requires-Dist: numba (>=0.50)
|
|
24
|
+
Requires-Dist: fixed-install-nmslib (==2.1.2)
|
|
25
|
+
Requires-Dist: hnswlib (>=0.7.0,<0.8.0)
|
|
26
|
+
Requires-Dist: lightning (>=2.0.2,<=2.4.0) ; extra == "torch" or extra == "all"
|
|
33
27
|
Requires-Dist: numpy (>=1.20.0)
|
|
34
28
|
Requires-Dist: optuna (>=3.2.0,<3.3.0)
|
|
35
29
|
Requires-Dist: pandas (>=1.3.5,<=2.2.2)
|
|
36
|
-
Requires-Dist: polars (>=0.
|
|
37
|
-
Requires-Dist: psutil (>=
|
|
30
|
+
Requires-Dist: polars (>=1.0.0,<1.1.0)
|
|
31
|
+
Requires-Dist: psutil (>=6.0.0,<6.1.0)
|
|
38
32
|
Requires-Dist: pyarrow (>=12.0.1)
|
|
39
|
-
Requires-Dist: pyspark (>=3.0,<3.
|
|
33
|
+
Requires-Dist: pyspark (>=3.0,<3.6) ; (python_full_version >= "3.8.1" and python_version < "3.11") and (extra == "spark" or extra == "all")
|
|
34
|
+
Requires-Dist: pyspark (>=3.4,<3.6) ; (python_version >= "3.11" and python_version < "3.12") and (extra == "spark" or extra == "all")
|
|
40
35
|
Requires-Dist: pytorch-ranger (>=0.1.1,<0.2.0) ; extra == "torch" or extra == "all"
|
|
41
|
-
Requires-Dist: sb-obp (>=0.5.7,<0.6.0)
|
|
42
36
|
Requires-Dist: scikit-learn (>=1.0.2,<2.0.0)
|
|
43
|
-
Requires-Dist: scipy (>=1.8.1,<
|
|
44
|
-
Requires-Dist: torch (>=1.8
|
|
37
|
+
Requires-Dist: scipy (>=1.8.1,<2.0.0)
|
|
38
|
+
Requires-Dist: torch (>=1.8,<=2.4.0) ; extra == "torch" or extra == "all"
|
|
45
39
|
Project-URL: Repository, https://github.com/sb-ai-lab/RePlay
|
|
46
40
|
Description-Content-Type: text/markdown
|
|
47
41
|
|
|
@@ -1,69 +1,17 @@
|
|
|
1
|
-
replay/__init__.py,sha256=
|
|
1
|
+
replay/__init__.py,sha256=CfUvW1hW04UHwi_dUOzcLqfgex6e2fWHaHTCl30i8LQ,47
|
|
2
2
|
replay/data/__init__.py,sha256=g5bKRyF76QL_BqlED-31RnS8pBdcyj9loMsx5vAG_0E,301
|
|
3
|
-
replay/data/dataset.py,sha256=
|
|
3
|
+
replay/data/dataset.py,sha256=FnvsFeIcCMlq94_NDQRY3-jgpVvKN-4FdivABWVr8Pk,29481
|
|
4
4
|
replay/data/dataset_utils/__init__.py,sha256=9wUvG8ZwGUvuzLU4zQI5FDcH0WVVo5YLN2ey3DterP0,55
|
|
5
|
-
replay/data/dataset_utils/dataset_label_encoder.py,sha256=
|
|
5
|
+
replay/data/dataset_utils/dataset_label_encoder.py,sha256=o8p7XvQewKuqYY8anrUhuY8gTau1FbpPjnNSAwbDZTY,9599
|
|
6
6
|
replay/data/nn/__init__.py,sha256=WxLsi4rgOuuvGYHN49xBPxP2Srhqf3NYgfBDVH-ZvBo,1122
|
|
7
|
-
replay/data/nn/schema.py,sha256=
|
|
7
|
+
replay/data/nn/schema.py,sha256=N6lBWC1Q_kX1s6oVdOaxxAYE2pWqwbkDK7LmLL8N1Ts,16208
|
|
8
8
|
replay/data/nn/sequence_tokenizer.py,sha256=Ambrp3CMOp3JP68PiwmVh0m-_zNXiWzxxVreHkEwOyY,32592
|
|
9
9
|
replay/data/nn/sequential_dataset.py,sha256=jCWxC0Pm1eQ5p8Y6_Bmg4fSEvPaecLrqz1iaWzaICdI,11014
|
|
10
10
|
replay/data/nn/torch_sequential_dataset.py,sha256=BqrK_PtkhpsaY1zRIWGk4EgwPL31a7IWCc0hLDuwDQc,10984
|
|
11
11
|
replay/data/nn/utils.py,sha256=YKE9gkIHZDDiwv4THqOWL4PzsdOujnPuM97v79Mwq0E,2769
|
|
12
12
|
replay/data/schema.py,sha256=F_cv6sYb6l23yuX5xWnbqoJ9oSeUT2NpIM19u8Lf2jA,15606
|
|
13
13
|
replay/data/spark_schema.py,sha256=4o0Kn_fjwz2-9dBY3q46F9PL0F3E7jdVpIlX7SG3OZI,1111
|
|
14
|
-
replay/
|
|
15
|
-
replay/experimental/metrics/__init__.py,sha256=W6S9YTGCezLORyTKCqL4Y_PniC1k3Bu5XWIM3WVHg2Q,2860
|
|
16
|
-
replay/experimental/metrics/base_metric.py,sha256=aYmKZ_336dRrlslBzYsgsOzmed54BNjNXsRcpzB5gyM,22648
|
|
17
|
-
replay/experimental/metrics/coverage.py,sha256=3kVBAUhIEOuD8aJ6DShH2xh_1F61dcLZb001VCkmeJk,3154
|
|
18
|
-
replay/experimental/metrics/experiment.py,sha256=Bd_XB9zbngcAwf5JLZKVPsFWQoz9pEGlPEUbkiR_MDc,7343
|
|
19
|
-
replay/experimental/metrics/hitrate.py,sha256=TfWJrUyZXabdMr4tn8zqUPGDcYy2yphVCzXmLSHCxY0,675
|
|
20
|
-
replay/experimental/metrics/map.py,sha256=S4dKiMpYR0_pu0bqioGMT0kIC1s2aojFP4rddBqMPtM,921
|
|
21
|
-
replay/experimental/metrics/mrr.py,sha256=q6I1Cndlwr716mMuYtTMu0lN8Rrp9khxhb49OM2IpV8,530
|
|
22
|
-
replay/experimental/metrics/ncis_precision.py,sha256=yrErOhBZvZdNpQPx_AXyktDJatqdWRIHNMyei0QDJtQ,1088
|
|
23
|
-
replay/experimental/metrics/ndcg.py,sha256=q3KTsyZCrfvcpEjEnR_kWVB9ZaTFRxnoNRAr2WD0TrU,1538
|
|
24
|
-
replay/experimental/metrics/precision.py,sha256=U9pD9yRGeT8uH32BTyQ-W5qsAnbFWu-pqy4XfkcXfCM,664
|
|
25
|
-
replay/experimental/metrics/recall.py,sha256=5xRPGxfbVoDFEI5E6dVlZpT4RvnDlWzaktyoqh3a8mc,774
|
|
26
|
-
replay/experimental/metrics/rocauc.py,sha256=yq4vW2_bXO8HCjREBZVrHMKeZ054LYvjJmLJTXWPfQA,1675
|
|
27
|
-
replay/experimental/metrics/surprisal.py,sha256=CK4_zed2bSMDwC7ZBCS8d8RwGEqt8bh3w3fTpjKiK6Y,3052
|
|
28
|
-
replay/experimental/metrics/unexpectedness.py,sha256=JQQXEYHtQM8nqp7X2He4E9ZYwbpdENaK8oQG7sUQT3s,2621
|
|
29
|
-
replay/experimental/models/__init__.py,sha256=R284PXgSxt-JWWwlSTLggchash0hrLfy4b2w-ySaQf4,588
|
|
30
|
-
replay/experimental/models/admm_slim.py,sha256=Oz-x0aQAnGFN9z7PB7MiKfduBasc4KQrBT0JwtYdwLY,6581
|
|
31
|
-
replay/experimental/models/base_neighbour_rec.py,sha256=pRcffr0cdRNZRVpzWb2Qv-UIsLkhbs7K1GRAmrSqPSM,7506
|
|
32
|
-
replay/experimental/models/base_rec.py,sha256=rj2r7r_mmJdzKAkg5CHG1eqJhOpUHAETPe0NwfibFjU,49606
|
|
33
|
-
replay/experimental/models/base_torch_rec.py,sha256=oDkCxVFQjIHSWKlCns6mU3ECWbQW3mQZWvBHBxJQdwc,8111
|
|
34
|
-
replay/experimental/models/cql.py,sha256=9ONDMblfxUgol5Pb2UInfSHVRbB2Ma15zAZC6valhtk,19628
|
|
35
|
-
replay/experimental/models/ddpg.py,sha256=sZrGgwj_kKeUnwwT9qooc4Cxz2oVGkNfUwUe1N7mreI,31982
|
|
36
|
-
replay/experimental/models/dt4rec/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
|
-
replay/experimental/models/dt4rec/dt4rec.py,sha256=ZIHYonDubStN7Gb703csy86R7Q3_1fZc4zJf98HYFe4,5895
|
|
38
|
-
replay/experimental/models/dt4rec/gpt1.py,sha256=T3buFtYyF6Fh6sW6f9dUZFcFEnQdljItbRa22CiKb0w,14044
|
|
39
|
-
replay/experimental/models/dt4rec/trainer.py,sha256=YeaJ8mnoYZqnPwm1P9qOYb8GzgFC5At-JeSDcvG2V2o,3859
|
|
40
|
-
replay/experimental/models/dt4rec/utils.py,sha256=jbCx2Xc85VtjQx-caYhJFfVuj1Wf866OAiSoZlR4q48,8201
|
|
41
|
-
replay/experimental/models/extensions/spark_custom_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
42
|
-
replay/experimental/models/extensions/spark_custom_models/als_extension.py,sha256=dKSVCMXWRB7IUnpEK_QNhSEuUSVcG793E8MT_AGXneY,25890
|
|
43
|
-
replay/experimental/models/implicit_wrap.py,sha256=8F-f-CaStmlNHwphu-yu8o4Aft08NKDD_SqqH0zp1Uo,4655
|
|
44
|
-
replay/experimental/models/lightfm_wrap.py,sha256=a2ctIEoZf7I0C_awiQI1lE4RGJ7ISs60znysgHRXZCw,11337
|
|
45
|
-
replay/experimental/models/mult_vae.py,sha256=FdJ-GL6Jj2l5-38edKp_jsNfwFNGPxMHXKn8cG2tGJs,11607
|
|
46
|
-
replay/experimental/models/neuromf.py,sha256=QRu--zIyOSQIp8R5Ksgiw7o0s5yOhQpuAX9YshKJs4w,14391
|
|
47
|
-
replay/experimental/models/scala_als.py,sha256=PVf0YA3ii4iRwGqpYg6nStgaauyrm9QTzLtK_4f1En0,10985
|
|
48
|
-
replay/experimental/nn/data/__init__.py,sha256=5EAF-FNd7xhkUpTq_5MyVcPXBD81mJCwYrcbhdGOWjE,48
|
|
49
|
-
replay/experimental/nn/data/schema_builder.py,sha256=5PphL9kK-tVm30nWdTjHUzqVOnTwKiU_MlxGdL5HJ8Y,1736
|
|
50
|
-
replay/experimental/preprocessing/__init__.py,sha256=uMyeyQ_GKqjLhVGwhrEk3NLhhzS0DKi5xGo3VF4WkiA,130
|
|
51
|
-
replay/experimental/preprocessing/data_preparator.py,sha256=fQ8Blo_uzA-2eC-_ViVeU26Tqj5lxLTCBoDJfEmiqUo,35968
|
|
52
|
-
replay/experimental/preprocessing/padder.py,sha256=o7S_Zk-ne_jria3QhWCKkYa6bEqhCdtvCA-R0MjOvU4,9569
|
|
53
|
-
replay/experimental/preprocessing/sequence_generator.py,sha256=E1_0uZJLv8V_n6YzRlgUWtcrHIdjNwPeBN-BMbz0e-A,9053
|
|
54
|
-
replay/experimental/scenarios/__init__.py,sha256=gWFLCkLyOmOppvbRMK7C3UMlMpcbIgiGVolSH6LPgWA,91
|
|
55
|
-
replay/experimental/scenarios/obp_wrapper/__init__.py,sha256=rsRyfsTnVNp20LkTEugwoBrV9XWbIhR8tOqec_Au6dY,450
|
|
56
|
-
replay/experimental/scenarios/obp_wrapper/obp_optuna_objective.py,sha256=vmLANYB5i1UR3uY7e-T0IBEYwPxOYHtKqhkmUvMUYhU,2548
|
|
57
|
-
replay/experimental/scenarios/obp_wrapper/replay_offline.py,sha256=A6TPBFHj_UUL0N6DHSF0-hACsH5cw2o1GMYvpPS6964,8756
|
|
58
|
-
replay/experimental/scenarios/obp_wrapper/utils.py,sha256=-ioWTb73NmHWxVxw4BdSolctqeeGIyjKtydwc45nrrk,3271
|
|
59
|
-
replay/experimental/scenarios/two_stages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
60
|
-
replay/experimental/scenarios/two_stages/reranker.py,sha256=tJtWhbHRNV4sJZ9RZzqIfylTplKh9QVwTIBhEGGnXq8,4244
|
|
61
|
-
replay/experimental/scenarios/two_stages/two_stages_scenario.py,sha256=ZgflnQ6xuxDFphdKX6Q0jtXidHS7c2YvDaccoaL78Qo,29846
|
|
62
|
-
replay/experimental/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
63
|
-
replay/experimental/utils/logger.py,sha256=UwLowaeOG17sDEe32LiZel8MnjSTzeW7J3uLG1iwLuA,639
|
|
64
|
-
replay/experimental/utils/model_handler.py,sha256=0ksSm5bJ1bL32VV5HI-KPe0a1EAzzOhMtmSYaM_zRrE,6271
|
|
65
|
-
replay/experimental/utils/session_handler.py,sha256=076TLpTOcnh13BznNTtJW6Zhrqvm9Ee1mlpP5YMD4No,1313
|
|
66
|
-
replay/metrics/__init__.py,sha256=KDkxVnKa4ks9K9GmlrdTx1pkIl-MAmm78ZASsp2ZndE,2812
|
|
14
|
+
replay/metrics/__init__.py,sha256=j0PGvUehaPEZMNo9SQwJsnvzrS4bam9eHrRMQFLnMjY,2813
|
|
67
15
|
replay/metrics/base_metric.py,sha256=uleW5vLrdA3iRx72tFyW0cxe6ne_ugQ1XaY_ZTcnAOo,15960
|
|
68
16
|
replay/metrics/categorical_diversity.py,sha256=OYsF-Ng-WrF9CC-sKgQKngrA779NO8MtgRvvAyC8MXM,10781
|
|
69
17
|
replay/metrics/coverage.py,sha256=wE1Y_TgKOzf_9ixeas-vsxANAHeHSGPuGrzKk8DklaY,8843
|
|
@@ -82,10 +30,10 @@ replay/metrics/surprisal.py,sha256=wj9Q5mAdECpl0LfykJWt8jgN3_CUSlai2fhiFgJr_Vw,7
|
|
|
82
30
|
replay/metrics/torch_metrics_builder.py,sha256=2gcCcb0A-TVpYcBIYGhXrggyFX-M_T7Q1pQUiMpxEZE,13845
|
|
83
31
|
replay/metrics/unexpectedness.py,sha256=cfDnkpK6nPeawwHDVNQAkUtsW0SvAttI84k4M5ttkyo,6888
|
|
84
32
|
replay/models/__init__.py,sha256=_4gNsauyrVMYEoFDihPYY9kGuBGGFyy1krvxF7oEYjk,808
|
|
85
|
-
replay/models/als.py,sha256=
|
|
33
|
+
replay/models/als.py,sha256=eGiMok_zu5ZUKXU9i9feCP4RGMqSnlIGHjks6MqKzHw,6227
|
|
86
34
|
replay/models/association_rules.py,sha256=cp4myXvMqro6zLMjJzJMb0DZ5DQFQEZvhqf5OBgBw8Y,14659
|
|
87
35
|
replay/models/base_neighbour_rec.py,sha256=zMORSm4uMQSNj12v0n_6w8fVHgSYjeiqyYE9rrWgSfU,7887
|
|
88
|
-
replay/models/base_rec.py,sha256=
|
|
36
|
+
replay/models/base_rec.py,sha256=NFz_xcarDwhaB3fSa-5uLBa6tyATOwOQLD_yR445m5U,66372
|
|
89
37
|
replay/models/cat_pop_rec.py,sha256=tzI1UMlC3kEOrtDZ1UPpCP13tX8CeDJP7PHwQKl9Mmo,11922
|
|
90
38
|
replay/models/cluster.py,sha256=9JcpGnbfgFa4UsyxPAa4WMuJFa3rsuAxiKoy-s_UfyE,4970
|
|
91
39
|
replay/models/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -106,8 +54,8 @@ replay/models/extensions/ann/index_inferers/__init__.py,sha256=47DEQpj8HBSa-_TIm
|
|
|
106
54
|
replay/models/extensions/ann/index_inferers/base_inferer.py,sha256=I39aqEc2somfndrCd-KC3XYZnYSrJ2hGpR9y6wO93NA,2524
|
|
107
55
|
replay/models/extensions/ann/index_inferers/hnswlib_filter_index_inferer.py,sha256=JjT4l_XAjzUOsTAE7OS88zAgPd_h_O44oUnn2kVr8E0,2477
|
|
108
56
|
replay/models/extensions/ann/index_inferers/hnswlib_index_inferer.py,sha256=CoY_oMfdcwnh87ceuSpHXu4Czle9xxeMisO8XJUuJLE,1717
|
|
109
|
-
replay/models/extensions/ann/index_inferers/nmslib_filter_index_inferer.py,sha256=
|
|
110
|
-
replay/models/extensions/ann/index_inferers/nmslib_index_inferer.py,sha256=
|
|
57
|
+
replay/models/extensions/ann/index_inferers/nmslib_filter_index_inferer.py,sha256=tjuqbkztWBU4K6qp5LPFU_GOGJf2f4oXneExtUEVUzw,3128
|
|
58
|
+
replay/models/extensions/ann/index_inferers/nmslib_index_inferer.py,sha256=S5eCBZlTXxEAeX6yeZGC7j56gOcJ7lMNb4Cs_5PEj9E,2203
|
|
111
59
|
replay/models/extensions/ann/index_inferers/utils.py,sha256=6IST2FPSY3nuYu5KqzRpd4FgdaV3GnQRQlxp9LN_yyA,641
|
|
112
60
|
replay/models/extensions/ann/index_stores/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
113
61
|
replay/models/extensions/ann/index_stores/base_index_store.py,sha256=u4l2ybAXX92ZMGK7NqqosbKF75QgFqhAMVadd5ePj6Y,910
|
|
@@ -125,7 +73,7 @@ replay/models/nn/sequential/__init__.py,sha256=CI2n0cxs_amqJrwBMq6n0Z_uBOu7CGXfa
|
|
|
125
73
|
replay/models/nn/sequential/bert4rec/__init__.py,sha256=JfZqHOGxcvOkICl5cWmZbZhaKXpkIvua-Wj57VWWEhw,399
|
|
126
74
|
replay/models/nn/sequential/bert4rec/dataset.py,sha256=sCnYGF-sQ1YlLq7vofQo2GIIlc59YlbUgmW7bHI6MPg,10324
|
|
127
75
|
replay/models/nn/sequential/bert4rec/lightning.py,sha256=TqO0V-g0JA0D-L2t08AgAIQgBkDtLUgl4xqekSiDWJ4,22605
|
|
128
|
-
replay/models/nn/sequential/bert4rec/model.py,sha256=
|
|
76
|
+
replay/models/nn/sequential/bert4rec/model.py,sha256=lZJwJbWPjrcvQCpD2LULMva-nXaTL8PgZHkZ-8z9okU,17758
|
|
129
77
|
replay/models/nn/sequential/callbacks/__init__.py,sha256=Q7mSZ_RB6iyD7QZaBL_NJ0uh8cRfgxq7gtPHbkSyhoo,282
|
|
130
78
|
replay/models/nn/sequential/callbacks/prediction_callbacks.py,sha256=H4MZ87_N0hCKtHbsTuN-Cq_SJ-n9TSkvv2okuGnwo3M,9045
|
|
131
79
|
replay/models/nn/sequential/callbacks/validation_callback.py,sha256=6TNl3NN9oahK1J7DT44461xqBuUCblCsLzUi2svlhF4,5825
|
|
@@ -135,7 +83,7 @@ replay/models/nn/sequential/postprocessors/postprocessors.py,sha256=V32xMyNPztJ5
|
|
|
135
83
|
replay/models/nn/sequential/sasrec/__init__.py,sha256=c6130lRpPkcbuGgkM7slagBIgH7Uk5zUtSzFDEwAsik,250
|
|
136
84
|
replay/models/nn/sequential/sasrec/dataset.py,sha256=ReGNc6t9jjXxMZJp0WqFj1jatJFHnWOrkK3W8lwBNIs,7036
|
|
137
85
|
replay/models/nn/sequential/sasrec/lightning.py,sha256=DtLnNikTNvqroCzaVFw7u-QZpZdvwiYbCwJLE7FkHms,21397
|
|
138
|
-
replay/models/nn/sequential/sasrec/model.py,sha256=
|
|
86
|
+
replay/models/nn/sequential/sasrec/model.py,sha256=EBAfDP3WHZC-Pyb8dm0mr3gpxhrCOFQDHbZ2itFPWmk,27780
|
|
139
87
|
replay/models/pop_rec.py,sha256=Ju9y2rU2vW_jFU9-W15fbbr5_ZzYGihSjSxsqKsAf0Q,4964
|
|
140
88
|
replay/models/query_pop_rec.py,sha256=UNsHtf3eQpJom73ZmEO5us4guI4SnCLJYTfuUpRgqes,4086
|
|
141
89
|
replay/models/random_rec.py,sha256=9SC012_X3sNzrAjDG1CPGhjisZb6gnv4VCW7yIMSNpk,8066
|
|
@@ -145,36 +93,35 @@ replay/models/ucb.py,sha256=X98ulD8L3gWR3VA7rbQkXFqQyzWc-Nt12lp_gbLTfLQ,6964
|
|
|
145
93
|
replay/models/wilson.py,sha256=o7aUWjq3648dAfgGBoWD5Gu-HzdyobPMaH2lzCLijiA,4558
|
|
146
94
|
replay/models/word2vec.py,sha256=MgoRIS5vqW9cH1HKAGa2xsLLnTH6XC1EXk4Dzvn5lXA,9171
|
|
147
95
|
replay/optimization/__init__.py,sha256=az6U10rF7X6rPRUUPwLyiM1WFNJ_6kl0imA5xLVWFLs,120
|
|
148
|
-
replay/optimization/optuna_objective.py,sha256=
|
|
96
|
+
replay/optimization/optuna_objective.py,sha256=OUYlC3wQj4GmrSbE_z5IPPS6OEEPUoeRCWFJnIR1Na8,7654
|
|
149
97
|
replay/preprocessing/__init__.py,sha256=TtBysFqYeDy4kZAEnWEaNSwPvbffYdfMkEs71YG51fM,411
|
|
150
|
-
replay/preprocessing/converter.py,sha256=
|
|
151
|
-
replay/preprocessing/filters.py,sha256=
|
|
152
|
-
replay/preprocessing/history_based_fp.py,sha256=
|
|
153
|
-
replay/preprocessing/label_encoder.py,sha256=
|
|
98
|
+
replay/preprocessing/converter.py,sha256=JQ-4u5x0eXtswl1iH-bZITBXQov1nebnZ6XcvpD8Twk,4417
|
|
99
|
+
replay/preprocessing/filters.py,sha256=4Lk3gnNwksPscdW6a47qJ_r8QEpbYRuNqTPJ9-bvSRo,41743
|
|
100
|
+
replay/preprocessing/history_based_fp.py,sha256=Wb2DXHawE2dYghm1ARr05_5opd_TLfthZ7h5e0zbDjY,18726
|
|
101
|
+
replay/preprocessing/label_encoder.py,sha256=JrVNP93NVt630OFmacQ6MlkH7rTLIPog05-0vyBuQtQ,27041
|
|
154
102
|
replay/preprocessing/sessionizer.py,sha256=G6i0K3FwqtweRxvcSYraJ-tBWAT2HnV-bWHHlIZJF-s,12217
|
|
155
|
-
replay/scenarios/__init__.py,sha256=
|
|
103
|
+
replay/scenarios/__init__.py,sha256=XXAKEQPTLlve-0O6NPwFgahFrb4oGcIq3HaYaaGxG2E,94
|
|
156
104
|
replay/scenarios/fallback.py,sha256=EeBmIR-5igzKR2m55bQRFyhxTkpJez6ZkCW449n8hWs,7130
|
|
157
105
|
replay/splitters/__init__.py,sha256=DnqVMelrzLwR8fGQgcWN_8FipGs8T4XGSPOMW-L_x2g,454
|
|
158
106
|
replay/splitters/base_splitter.py,sha256=hj9_GYDWllzv3XnxN6WHu1JKRRVjXo77vZEOLbF9v-s,7761
|
|
159
107
|
replay/splitters/cold_user_random_splitter.py,sha256=gVwBVdn_0IOaLGT_UzJoS9AMaPhelZy-FpC5JQS1PhA,4136
|
|
160
108
|
replay/splitters/k_folds.py,sha256=WH02_DP18A2ae893ysonmfLPB56_i1ETllTAwaCYekg,6218
|
|
161
|
-
replay/splitters/last_n_splitter.py,sha256=
|
|
109
|
+
replay/splitters/last_n_splitter.py,sha256=ITq8yzd7PrbAi3yp5XJlBehq0E0boiPyTEn72sXZEOA,15347
|
|
162
110
|
replay/splitters/new_users_splitter.py,sha256=bv_QCPkL7KFxJIovAXQbP3Rlty3My48YNTqrj-2ucFQ,9167
|
|
163
111
|
replay/splitters/random_splitter.py,sha256=mbOcxeF0B9WQ9OSxK8CHkPtO8UzKCZJt3rRyFhn-hyQ,2996
|
|
164
112
|
replay/splitters/ratio_splitter.py,sha256=8zvuCn16Icc4ntQPKXJ5ArAWuJzCZ9NHZtgWctKyBVY,17519
|
|
165
|
-
replay/splitters/time_splitter.py,sha256=
|
|
166
|
-
replay/splitters/two_stage_splitter.py,sha256=
|
|
113
|
+
replay/splitters/time_splitter.py,sha256=tsoK3Qg_pcYHDxBlv2xC8ohAikoIqac3fRGBvCb-QRo,9026
|
|
114
|
+
replay/splitters/two_stage_splitter.py,sha256=U90l1wfJnMAAW1j4YpJSd8zWvWB-LDUKFCifnanXraU,17830
|
|
167
115
|
replay/utils/__init__.py,sha256=vDJgOWq81fbBs-QO4ZDpdqR4KDyO1kMOOxBRi-5Gp7E,253
|
|
168
116
|
replay/utils/common.py,sha256=s4Pro3QCkPeVBsj-s0vrbhd_pkJD-_-2M_sIguxGzQQ,5411
|
|
169
117
|
replay/utils/dataframe_bucketizer.py,sha256=LipmBBQkdkLGroZpbP9i7qvTombLdMxo2dUUys1m5OY,3748
|
|
170
|
-
replay/utils/distributions.py,sha256=
|
|
118
|
+
replay/utils/distributions.py,sha256=UuhaC9HI6HnUXW97fEd-TsyDk4JT8t7k1T_6l5FpOMs,1203
|
|
171
119
|
replay/utils/model_handler.py,sha256=V-mHDh8_UexjVSsMBBRA9yrjS_5MPHwYOwv_UrI-Zfs,6466
|
|
172
|
-
replay/utils/session_handler.py,sha256=
|
|
173
|
-
replay/utils/spark_utils.py,sha256=
|
|
120
|
+
replay/utils/session_handler.py,sha256=RYzQvvOnukundccEBnH4ghEdyUgiGB9etz5e3Elvfgw,5157
|
|
121
|
+
replay/utils/spark_utils.py,sha256=LBzS8PJc6Mq8q7S_f6BbQZkeOEW49briAdp--pwFWbs,26891
|
|
174
122
|
replay/utils/time.py,sha256=J8asoQBytPcNw-BLGADYIsKeWhIoN1H5hKiX9t2AMqo,9376
|
|
175
123
|
replay/utils/types.py,sha256=5sw0A7NG4ZgQKdWORnBy0wBZ5F98sP_Ju8SKQ6zbDS4,651
|
|
176
|
-
replay_rec-0.
|
|
177
|
-
replay_rec-0.
|
|
178
|
-
replay_rec-0.
|
|
179
|
-
replay_rec-0.
|
|
180
|
-
replay_rec-0.17.1rc0.dist-info/RECORD,,
|
|
124
|
+
replay_rec-0.18.0.dist-info/LICENSE,sha256=rPmcA7UrHxBChEAAlJyE24qUWKKl9yLQXxFsKeg_LX4,11344
|
|
125
|
+
replay_rec-0.18.0.dist-info/METADATA,sha256=GqTiw9bPlIkXG9mwL0a_2V8EuPsImj9oZzvonqiR0Ug,10863
|
|
126
|
+
replay_rec-0.18.0.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
|
|
127
|
+
replay_rec-0.18.0.dist-info/RECORD,,
|
replay/experimental/__init__.py
DELETED
|
File without changes
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Most metrics require dataframe with recommendations
|
|
3
|
-
and dataframe with ground truth values —
|
|
4
|
-
which objects each user interacted with.
|
|
5
|
-
|
|
6
|
-
- recommendations (Union[pandas.DataFrame, spark.DataFrame]):
|
|
7
|
-
predictions of a recommender system,
|
|
8
|
-
DataFrame with columns ``[user_id, item_id, relevance]``
|
|
9
|
-
- ground_truth (Union[pandas.DataFrame, spark.DataFrame]):
|
|
10
|
-
test data, DataFrame with columns
|
|
11
|
-
``[user_id, item_id, timestamp, relevance]``
|
|
12
|
-
|
|
13
|
-
Metric is calculated for all users, presented in ``ground_truth``
|
|
14
|
-
for accurate metric calculation in case when the recommender system generated
|
|
15
|
-
recommendation not for all users. It is assumed, that all users,
|
|
16
|
-
we want to calculate metric for, have positive interactions.
|
|
17
|
-
|
|
18
|
-
But if we have users, who observed the recommendations, but have not responded,
|
|
19
|
-
those users will be ignored and metric will be overestimated.
|
|
20
|
-
For such case we propose additional optional parameter ``ground_truth_users``,
|
|
21
|
-
the dataframe with all users, which should be considered during the metric calculation.
|
|
22
|
-
|
|
23
|
-
- ground_truth_users (Optional[Union[pandas.DataFrame, spark.DataFrame]]):
|
|
24
|
-
full list of users to calculate metric for, DataFrame with ``user_id`` column
|
|
25
|
-
|
|
26
|
-
Every metric is calculated using top ``K`` items for each user.
|
|
27
|
-
It is also possible to calculate metrics
|
|
28
|
-
using multiple values for ``K`` simultaneously.
|
|
29
|
-
In this case the result will be a dictionary and not a number.
|
|
30
|
-
|
|
31
|
-
Make sure your recommendations do not contain user-item duplicates
|
|
32
|
-
as duplicates could lead to the wrong calculation results.
|
|
33
|
-
|
|
34
|
-
- k (Union[Iterable[int], int]):
|
|
35
|
-
a single number or a list, specifying the
|
|
36
|
-
truncation length for recommendation list for each user
|
|
37
|
-
|
|
38
|
-
By default, metrics are averaged by users,
|
|
39
|
-
but you can alternatively use method ``metric.median``.
|
|
40
|
-
Also, you can get the lower bound
|
|
41
|
-
of ``conf_interval`` for a given ``alpha``.
|
|
42
|
-
|
|
43
|
-
Diversity metrics require extra parameters on initialization stage,
|
|
44
|
-
but do not use ``ground_truth`` parameter.
|
|
45
|
-
|
|
46
|
-
For each metric, a formula for its calculation is given, because this is
|
|
47
|
-
important for the correct comparison of algorithms, as mentioned in our
|
|
48
|
-
`article <https://arxiv.org/abs/2206.12858>`_.
|
|
49
|
-
"""
|
|
50
|
-
from replay.experimental.metrics.base_metric import Metric, NCISMetric
|
|
51
|
-
from replay.experimental.metrics.coverage import Coverage
|
|
52
|
-
from replay.experimental.metrics.hitrate import HitRate
|
|
53
|
-
from replay.experimental.metrics.map import MAP
|
|
54
|
-
from replay.experimental.metrics.mrr import MRR
|
|
55
|
-
from replay.experimental.metrics.ncis_precision import NCISPrecision
|
|
56
|
-
from replay.experimental.metrics.ndcg import NDCG
|
|
57
|
-
from replay.experimental.metrics.precision import Precision
|
|
58
|
-
from replay.experimental.metrics.recall import Recall
|
|
59
|
-
from replay.experimental.metrics.rocauc import RocAuc
|
|
60
|
-
from replay.experimental.metrics.surprisal import Surprisal
|
|
61
|
-
from replay.experimental.metrics.unexpectedness import Unexpectedness
|