Skip to content

Commit

Permalink
Merge pull request #2144 from recommenders-team/daviddavo/lightfm-exp…
Browse files Browse the repository at this point in the history
…erimental

Marked lightfm tests as experimental
  • Loading branch information
miguelgfierro authored Aug 14, 2024
2 parents 7ab9cd4 + 852956e commit 69c9c20
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions tests/unit/recommenders/models/test_lightfm_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
import itertools
import numpy as np
import pandas as pd
from lightfm.data import Dataset
from lightfm import LightFM, cross_validation

from recommenders.models.lightfm.lightfm_utils import (
track_model_metrics,
similar_users,
similar_items,
)
try:
from lightfm.data import Dataset
from lightfm import LightFM, cross_validation
from recommenders.models.lightfm.lightfm_utils import (
track_model_metrics,
similar_users,
similar_items,
)
except ModuleNotFoundError:
pass


SEEDNO = 42
Expand Down Expand Up @@ -128,6 +131,7 @@ def sim_items(interactions, fitting):
)


@pytest.mark.experimental
def test_interactions(interactions):
train_interactions, test_interactions, item_features, user_features = interactions
assert train_interactions.shape == (10, 10)
Expand All @@ -136,6 +140,7 @@ def test_interactions(interactions):
assert user_features.shape == (10, 17)


@pytest.mark.experimental
@pytest.mark.skip(reason="Flaky test")
def test_fitting(fitting):
output, _ = fitting
Expand All @@ -152,9 +157,11 @@ def test_fitting(fitting):
np.testing.assert_array_equal(output, target)


@pytest.mark.experimental
def test_sim_users(sim_users):
assert sim_users.shape == (5, 2)


@pytest.mark.experimental
def test_sim_items(sim_items):
assert sim_items.shape == (5, 2)

0 comments on commit 69c9c20

Please sign in to comment.