Skip to content

Commit

Permalink
Merge pull request #1630 from microsoft/andreas/surprise
Browse files Browse the repository at this point in the history
Add back scikit-surprise to dependencies
  • Loading branch information
anargyri authored Feb 3, 2022
2 parents e92c880 + 8557d7a commit 7425d21
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 18 deletions.
3 changes: 1 addition & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ To setup the documentation, first you need to install the dependencies of the fu
conda create -n reco_full -c conda-forge python=3.7 cudatoolkit=11.2 cudnn=8.1
conda activate reco_full

pip install numpy cython
pip install --no-binary scikit-surprise "scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz"
pip install numpy
pip install "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip"
pip install sphinx_rtd_theme

Expand Down
1 change: 0 additions & 1 deletion recommenders/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ We are currently evaluating inclusion of the following dependencies:
## Other dependencies

Some dependencies are not available via the recommenders PyPI package, but can be installed in the following ways:
- scikit-surprise: due to incompatibilities with `numpy <= 1.19`, proper installation of Surprise requires `pip install numpy cython` and `pip install --no-binary scikit-surprise "scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz"`
- pymanopt: this dependency is required for the RLRMC and GeoIMC algorithms; a version of this code compatible with TensorFlow 2 can be
installed with `pip install "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip"`.

Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"cornac>=1.1.2,<2",
"retrying>=1.3.3",
"pandera[strategies]>=0.6.5", # For generating fake datasets
"scikit-surprise>=1.0.6"
]

# shared dependencies
Expand Down Expand Up @@ -98,10 +99,7 @@
"nni==1.5",
]

# The following dependencies can be installed as below, however PyPI does not allow direct URLs.
# Surprise needs to be built from source because of the numpy <= 1.19 incompatibility
# Requires pip to be run with the --no-binary option
# "scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz",
# The following dependency can be installed as below, however PyPI does not allow direct URLs.
# Temporary fix for pymanopt, only this commit works with TF2
# "pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip",

Expand Down
2 changes: 1 addition & 1 deletion tests/ci/azure_pipeline_test/dsvm_nightly_linux_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ extends:
timeout: 180
conda_env: "nightly_linux_cpu"
conda_opts: "python=3.7"
pip_opts: "[examples,dev,experimental] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise"
pip_opts: "[examples,dev,experimental] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache"
pytest_markers: "not spark and not gpu"
pytest_params: "-x"
2 changes: 1 addition & 1 deletion tests/ci/azure_pipeline_test/dsvm_notebook_linux_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ extends:
task_name: "Test - Unit Notebook Linux CPU"
conda_env: "unit_notebook_linux_cpu"
conda_opts: "python=3.7"
pip_opts: "[examples,dev,experimental] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise"
pip_opts: "[examples,dev,experimental] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache"
pytest_markers: "notebooks and not spark and not gpu"
2 changes: 1 addition & 1 deletion tests/ci/azure_pipeline_test/dsvm_unit_linux_cpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,5 @@ extends:
task_name: "Test - Unit Linux CPU"
conda_env: "unit_linux_cpu"
conda_opts: "python=3.7"
pip_opts: "[dev,experimental] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise"
pip_opts: "[dev,experimental] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache"
pytest_markers: "not notebooks and not spark and not gpu"
6 changes: 3 additions & 3 deletions tests/ci/azure_pipeline_test/release_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
task_name: "Test - Unit Linux CPU"
conda_env: "release_unit_linux_cpu"
conda_opts: "python=3.7"
pip_opts: "[experimental,dev] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise"
pip_opts: "[experimental,dev] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache"
pytest_markers: "not notebooks and not spark and not gpu"
install: "release"
package: "publish"
Expand All @@ -35,7 +35,7 @@ jobs:
task_name: "Test - Unit Notebook Linux CPU"
conda_env: "release_unit_notebook_linux_cpu"
conda_opts: "python=3.7"
pip_opts: "[experimental,examples,dev] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise"
pip_opts: "[experimental,examples,dev] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache"
pytest_markers: "notebooks and not spark and not gpu"
install: "release"

Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
timeout: 180
conda_env: "release_nightly_linux_cpu"
conda_opts: "python=3.7"
pip_opts: "[experimental,examples,dev] 'scikit-surprise@https://github.com/NicolasHug/Surprise/archive/refs/tags/v1.1.1.tar.gz' 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache --no-binary scikit-surprise"
pip_opts: "[experimental,examples,dev] 'pymanopt@https://github.com/pymanopt/pymanopt/archive/fb36a272cdeecb21992cfd9271eb82baafeb316d.zip' --no-cache"
pytest_markers: "not spark and not gpu"
install: "release"

Expand Down
1 change: 0 additions & 1 deletion tests/integration/examples/test_notebooks_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ def test_baseline_deep_dive_integration(
assert results[key] == pytest.approx(value, rel=TOL, abs=ABS_TOL)


@pytest.mark.experimental
@pytest.mark.integration
@pytest.mark.parametrize(
"size, expected_values",
Expand Down
1 change: 0 additions & 1 deletion tests/smoke/examples/test_notebooks_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ def test_baseline_deep_dive_smoke(notebooks, output_notebook, kernel_name):
assert results["recall"] == pytest.approx(0.108826, rel=TOL, abs=ABS_TOL)


@pytest.mark.experimental
@pytest.mark.smoke
def test_surprise_svd_smoke(notebooks, output_notebook, kernel_name):
notebook_path = notebooks["surprise_svd_deep_dive"]
Expand Down
1 change: 0 additions & 1 deletion tests/unit/examples/test_notebooks_python.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_baseline_deep_dive_runs(notebooks, output_notebook, kernel_name):
pm.execute_notebook(notebook_path, output_notebook, kernel_name=kernel_name)


@pytest.mark.experimental
@pytest.mark.notebooks
def test_surprise_deep_dive_runs(notebooks, output_notebook, kernel_name):
notebook_path = notebooks["surprise_svd_deep_dive"]
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/recommenders/models/test_surprise_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def rating_true():
)


@pytest.mark.experimental
def test_predict(rating_true):
svd = surprise.SVD()
train_set = surprise.Dataset.load_from_df(
Expand Down Expand Up @@ -87,7 +86,6 @@ def test_predict(rating_true):
].values == pytest.approx(svd.predict(user, item).est, rel=TOL)


@pytest.mark.experimental
def test_recommend_k_items(rating_true):
n_users = len(rating_true["userID"].unique())
n_items = len(rating_true["itemID"].unique())
Expand Down

0 comments on commit 7425d21

Please sign in to comment.