diff --git a/.github/workflows/sarplus.yml b/.github/workflows/sarplus.yml index d2a04044b..6df1c6c9b 100644 --- a/.github/workflows/sarplus.yml +++ b/.github/workflows/sarplus.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-22.04 strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9"] steps: - uses: actions/checkout@v3 diff --git a/recommenders/models/deeprec/models/sequential/rnn_cell_implement.py b/recommenders/models/deeprec/models/sequential/rnn_cell_implement.py index 98424cd29..df7ea906f 100644 --- a/recommenders/models/deeprec/models/sequential/rnn_cell_implement.py +++ b/recommenders/models/deeprec/models/sequential/rnn_cell_implement.py @@ -581,9 +581,9 @@ def __init__( ): self._build_bias = build_bias - if args is None or (nest.is_nested(args) and not args): + if args is None or (nest.is_sequence(args) and not args): raise ValueError("`args` must be specified") - if not nest.is_nested(args): + if not nest.is_sequence(args): args = [args] self._is_sequence = False else: diff --git a/recommenders/models/rlrmc/RLRMCdataset.py b/recommenders/models/rlrmc/RLRMCdataset.py index 7670105b3..6b1329d1d 100644 --- a/recommenders/models/rlrmc/RLRMCdataset.py +++ b/recommenders/models/rlrmc/RLRMCdataset.py @@ -68,8 +68,8 @@ def _data_processing(self, train, validation=None, test=None, mean_center=True): """ # Data processing and reindexing code is adopted from https://github.com/Microsoft/Recommenders/blob/main/recommenders/models/ncf/dataset.py # If validation dataset is None - df = train if validation is None else pd.concat([train, validation]) - df = df if test is None else pd.concat([df, test]) + df = train if validation is None else train.append(validation) + df = df if test is None else df.append(test) # Reindex user and item index if self.user_idx is None: diff --git a/recommenders/models/tfidf/tfidf_utils.py b/recommenders/models/tfidf/tfidf_utils.py index 9a3f363ed..24575121c 100644 --- a/recommenders/models/tfidf/tfidf_utils.py +++ b/recommenders/models/tfidf/tfidf_utils.py @@ -115,7 +115,7 @@ def clean_dataframe(self, df, cols_to_clean, new_col_name="cleaned_text"): return df def tokenize_text( - self, df_clean, text_col="cleaned_text", ngram_range=(1, 3), min_df=1 + self, df_clean, text_col="cleaned_text", ngram_range=(1, 3), min_df=0 ): """Tokenize the input text. For more details on the TfidfVectorizer, see https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfVectorizer.html diff --git a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py index c7bb73228..79a189ccc 100644 --- a/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py +++ b/tests/ci/azureml_tests/submit_groupwise_azureml_pytest.py @@ -37,6 +37,7 @@ """ import argparse import logging +import glob from azureml.core.authentication import AzureCliAuthentication from azureml.core import Workspace diff --git a/tests/unit/recommenders/evaluation/test_python_evaluation.py b/tests/unit/recommenders/evaluation/test_python_evaluation.py index cd54ec36b..e5837fc66 100644 --- a/tests/unit/recommenders/evaluation/test_python_evaluation.py +++ b/tests/unit/recommenders/evaluation/test_python_evaluation.py @@ -6,7 +6,7 @@ import pytest from unittest.mock import Mock from sklearn.preprocessing import minmax_scale -from pandas.testing import assert_frame_equal +from pandas.util.testing import assert_frame_equal from recommenders.utils.constants import ( DEFAULT_USER_COL, diff --git a/tests/unit/recommenders/evaluation/test_spark_evaluation.py b/tests/unit/recommenders/evaluation/test_spark_evaluation.py index dc7917fc3..9cf35ee3e 100644 --- a/tests/unit/recommenders/evaluation/test_spark_evaluation.py +++ b/tests/unit/recommenders/evaluation/test_spark_evaluation.py @@ -4,7 +4,7 @@ import numpy as np import pandas as pd import pytest -from pandas.testing import assert_frame_equal +from pandas.util.testing import assert_frame_equal from recommenders.evaluation.python_evaluation import ( precision_at_k, @@ -441,7 +441,7 @@ def test_item_novelty(spark_diversity_data, target_metrics): ) actual = evaluator.historical_item_novelty().toPandas() assert_frame_equal( - target_metrics["item_novelty"], actual, check_exact=False, atol=0.0001, + target_metrics["item_novelty"], actual, check_exact=False, check_less_precise=4 ) assert np.all(actual["item_novelty"].values >= 0) # Test that novelty is zero when data includes only one item @@ -482,7 +482,7 @@ def test_user_diversity(spark_diversity_data, target_metrics): target_metrics["user_diversity"], actual, check_exact=False, - atol=0.0001, + check_less_precise=4, ) @@ -510,7 +510,7 @@ def test_user_item_serendipity(spark_diversity_data, target_metrics): target_metrics["user_item_serendipity"], actual, check_exact=False, - atol=0.0001, + check_less_precise=4, ) @@ -529,7 +529,7 @@ def test_user_serendipity(spark_diversity_data, target_metrics): target_metrics["user_serendipity"], actual, check_exact=False, - atol=0.0001, + check_less_precise=4, ) @@ -562,7 +562,7 @@ def test_user_diversity_item_feature_vector(spark_diversity_data, target_metrics target_metrics["user_diversity_item_feature_vector"], actual, check_exact=False, - atol=0.0001, + check_less_precise=4, ) @@ -599,7 +599,7 @@ def test_user_item_serendipity_item_feature_vector( target_metrics["user_item_serendipity_item_feature_vector"], actual, check_exact=False, - atol=0.0001, + check_less_precise=4, ) @@ -620,7 +620,7 @@ def test_user_serendipity_item_feature_vector(spark_diversity_data, target_metri target_metrics["user_serendipity_item_feature_vector"], actual, check_exact=False, - atol=0.0001, + check_less_precise=4, )