Skip to content

Commit

Permalink
Merge pull request #350 from mdekstrand/tweak/cleanup-extensions
Browse files Browse the repository at this point in the history
Clean up legacy extension imports
  • Loading branch information
mdekstrand committed Nov 12, 2023
2 parents 3f43b0e + cad318b commit 154086e
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 44 deletions.
1 change: 0 additions & 1 deletion lenskit/algorithms/hpf.py

This file was deleted.

1 change: 0 additions & 1 deletion lenskit/algorithms/implicit.py

This file was deleted.

5 changes: 0 additions & 5 deletions lenskit/algorithms/tf.py

This file was deleted.

37 changes: 0 additions & 37 deletions tests/test_ml20m.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,14 @@
import logging
from pathlib import Path

import pandas as pd
import numpy as np

from lenskit.datasets import MovieLens
from lenskit import crossfold as xf
from lenskit.metrics import predict as pm
from lenskit import batch
from lenskit.algorithms import Recommender
from lenskit.algorithms.basic import Popular
from lenskit.algorithms.als import BiasedMF
from lenskit.algorithms import item_knn as knn

try:
import lenskit_tf
except:
lenskit_tf = None
from lenskit.util import Stopwatch
from lenskit.util import test as lktu

import pytest
from pytest import approx

_log = logging.getLogger(__name__)

Expand Down Expand Up @@ -76,27 +63,3 @@ def test_als_isolate(ml20m, rng):
assert len(preds) == len(pairs)
finally:
ares.close()


@pytest.mark.realdata
@pytest.mark.slow
@pytest.mark.skip
@pytest.mark.skipif(
lenskit_tf is None or not lenskit_tf.TF_AVAILABLE, reason="TensorFlow not available"
)
def test_tf_isvd(ml20m):
algo = lenskit_tf.IntegratedBiasMF(20)

def eval(train, test):
_log.info("running training")
algo.fit(train)
_log.info("testing %d users", test.user.nunique())
return batch.predict(algo, test)

folds = xf.sample_users(ml20m, 2, 5000, xf.SampleFrac(0.2))
preds = pd.concat(eval(train, test) for (train, test) in folds)
mae = pm.mae(preds.prediction, preds.rating)
assert mae == approx(0.60, abs=0.025)

user_rmse = preds.groupby("user").apply(lambda df: pm.rmse(df.prediction, df.rating))
assert user_rmse.mean() == approx(0.92, abs=0.05)

0 comments on commit 154086e

Please sign in to comment.