Skip to content

Commit

Permalink
Merge pull request #2122 from recommenders-team/miguel/lightfm_extras
Browse files Browse the repository at this point in the history
Remove LightFM from core package
  • Loading branch information
miguelgfierro committed Jul 1, 2024
2 parents 1916ea0 + cf64eed commit 41349b1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"source": [
"This notebook explains the concept of a Factorization Machine based model for recommendation, it also outlines the steps to construct a pure matrix factorization and a Factorization Machine using the [LightFM](https://github.com/lyst/lightfm) package. It also demonstrates how to extract both user and item affinity from a fitted model.\n",
"\n",
"*NOTE: LightFM is not available in the core package of Recommenders, to run this notebook, install the experimental package with `pip install recommenders[experimental]`.*\n",
"\n",
"## 1. Factorization Machine model\n",
"\n",
"### 1.1 Background\n",
Expand Down
2 changes: 1 addition & 1 deletion recommenders/datasets/movielens.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ def unique_columns(df, *, columns):
return not df[columns].duplicated().any()


class MockMovielensSchema(pa.SchemaModel):
class MockMovielensSchema(pa.DataFrameModel):
"""
Mock dataset schema to generate fake data for testing purpose.
This schema is configured to mimic the Movielens dataset
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
"category-encoders>=2.6.0,<3", # requires packaging
"cornac>=1.15.2,<2", # requires packaging, tqdm
"hyperopt>=0.2.7,<1",
"lightfm>=1.17,<2", # requires requests
"lightgbm>=4.0.0,<5",
"locust>=2.12.2,<3", # requires jinja2
"memory-profiler>=0.61.0,<1",
Expand Down Expand Up @@ -80,6 +79,7 @@
# nni needs to be upgraded
"nni==1.5",
"pymanopt>=0.2.5",
"lightfm>=1.17,<2",
]

# The following dependency can be installed as below, however PyPI does not allow direct URLs.
Expand Down
17 changes: 11 additions & 6 deletions tests/ci/azureml_tests/test_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
"tests/functional/examples/test_notebooks_python.py::test_geoimc_functional", # 1006.19s
#
"tests/functional/examples/test_notebooks_python.py::test_benchmark_movielens_cpu", # 58s
#
"tests/functional/examples/test_notebooks_python.py::test_lightfm_functional",
],
"group_cpu_003": [ # Total group time: 2253s
"tests/data_validation/recommenders/datasets/test_criteo.py::test_download_criteo_sample", # 1.05s
Expand Down Expand Up @@ -237,10 +235,6 @@
"tests/unit/recommenders/models/test_geoimc.py::test_imcproblem",
"tests/unit/recommenders/models/test_geoimc.py::test_inferer_init",
"tests/unit/recommenders/models/test_geoimc.py::test_inferer_infer",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_interactions",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_fitting",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_sim_users",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_sim_items",
"tests/unit/recommenders/models/test_sar_singlenode.py::test_init",
"tests/unit/recommenders/models/test_sar_singlenode.py::test_fit",
"tests/unit/recommenders/models/test_sar_singlenode.py::test_predict",
Expand Down Expand Up @@ -453,3 +447,14 @@
"tests/unit/examples/test_notebooks_gpu.py::test_gpu_vm",
],
}

# Experimental are additional test groups that require to install extra dependencies: pip install .[experimental]
experimental_test_groups = {
"group_cpu_001": [
"tests/unit/recommenders/models/test_lightfm_utils.py::test_interactions",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_fitting",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_sim_users",
"tests/unit/recommenders/models/test_lightfm_utils.py::test_sim_items",
"tests/functional/examples/test_notebooks_python.py::test_lightfm_functional",
]
}

0 comments on commit 41349b1

Please sign in to comment.