From ccde1f3cc9c1ec9fad93bf2d753a660a2275ed68 Mon Sep 17 00:00:00 2001 From: Michael Ekstrand Date: Thu, 25 Jul 2024 15:56:18 -0400 Subject: [PATCH] fix batch_predict ML100K --- lenskit/tests/test_batch_predict.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/lenskit/tests/test_batch_predict.py b/lenskit/tests/test_batch_predict.py index 9619925b3..ddd7dec12 100644 --- a/lenskit/tests/test_batch_predict.py +++ b/lenskit/tests/test_batch_predict.py @@ -122,17 +122,14 @@ def test_predict_include_rating(mlb: MLB): assert all(preds.rating.values == urv.loc[preds.index, :].rating.values) -@pytest.mark.skipif(not lktu.ml100k.available, reason="ML-100K required") @pytest.mark.eval @pytest.mark.parametrize("ncpus", [None, 1, 2]) -def test_bias_batch_predict(ncpus): +def test_bias_batch_predict(ml_100k, ncpus): import lenskit.crossfold as xf import lenskit.metrics.predict as pm from lenskit import batch from lenskit.algorithms import bias - ratings = lktu.ml100k.ratings - algo = bias.Bias(damping=5) def eval(train, test): @@ -143,7 +140,7 @@ def eval(train, test): return recs preds = pd.concat( - (eval(train, test) for (train, test) in xf.partition_users(ratings, 5, xf.SampleFrac(0.2))) + (eval(train, test) for (train, test) in xf.partition_users(ml_100k, 5, xf.SampleFrac(0.2))) ) _log.info("analyzing predictions")