Skip to content

Commit

Permalink
use training options for HPF tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mdekstrand committed Jan 11, 2025
1 parent 38a00cc commit c09e26c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lenskit-hpf/tests/test_hpf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from lenskit.metrics import quick_measure_model
from lenskit.pipeline import topn_pipeline
from lenskit.testing import BasicComponentTests, ScorerTests
from lenskit.training import TrainingOptions

hpf = importorskip("lenskit.hpf")

Expand Down Expand Up @@ -47,7 +48,7 @@ def test_hpf_train_large(tmp_path, ml_ratings):
assert np.all(a2.item_features_ == algo.item_features_)

pipe = topn_pipeline(algo)
pipe.train(ds, retrain=False)
pipe.train(ds, TrainingOptions(retrain=False))

for u in np.random.choice(ratings.user_id.unique(), size=50, replace=False):
recs = pipe.run("recommender", query=u, n=50)
Expand Down Expand Up @@ -76,7 +77,7 @@ def test_hpf_train_binary(tmp_path, ml_ratings):
assert np.all(a2.item_features_ == algo.item_features_)

pipe = topn_pipeline(algo)
pipe.train(ds, retrain=False)
pipe.train(ds, TrainingOptions(retrain=False))

for u in np.random.choice(ratings.user_id.unique(), size=50, replace=False):
recs = pipe.run("recommender", query=u, n=50)
Expand Down

0 comments on commit c09e26c

Please sign in to comment.