Skip to content

Update TriRank documentation#619

Merged
qtuantruong merged 1 commit intomasterfrom
618-bug-trirank-documentation-xy
May 20, 2024
Merged

Update TriRank documentation#619
qtuantruong merged 1 commit intomasterfrom
618-bug-trirank-documentation-xy

Conversation

@lthoang
Copy link
Copy Markdown
Member

@lthoang lthoang commented May 16, 2024

Description

Related Issues

#618

Checklist:

  • I have added tests.
  • I have updated the documentation accordingly.
  • I have updated README.md (if you are adding a new model).
  • I have updated examples/README.md (if you are adding a new example).
  • I have updated datasets/README.md (if you are adding a new dataset).

@lthoang lthoang linked an issue May 16, 2024 that may be closed by this pull request
@github-actions github-actions bot added the models New models, changes to models label May 16, 2024
@qtuantruong
Copy link
Copy Markdown
Member

qtuantruong commented May 16, 2024

@lthoang there is a failed unit test related to NextItemRecommender. See the log below:

_______________________ TestNextItemRecommender.test_fit _______________________

self = <models.test_recommender.TestNextItemRecommender testMethod=test_fit>

    def test_fit(self):
        dataset = SequentialDataset.from_usit(self.data)
        model = NextItemRecommender("")
        model.fit(dataset)
        model = SPop()
        model.fit(dataset)
        model.score(0, [])
        result = model.rank(0, history_items=[])
>       self.assertTrue((result[0] == [3, 2, 4, 1, 0, 5, 8, 7, 6]).all())
E       AssertionError: False is not true

tests/cornac/models/test_recommender.py:88: AssertionError

There might be some randomness in this test where it passes most of the time but fails rarely?

@lthoang lthoang self-assigned this May 16, 2024
@lthoang lthoang requested a review from qtuantruong May 16, 2024 19:51
@lthoang
Copy link
Copy Markdown
Member Author

lthoang commented May 17, 2024

@lthoang there is a failed unit test related to NextItemRecommender. See the log below:

_______________________ TestNextItemRecommender.test_fit _______________________

self = <models.test_recommender.TestNextItemRecommender testMethod=test_fit>

    def test_fit(self):
        dataset = SequentialDataset.from_usit(self.data)
        model = NextItemRecommender("")
        model.fit(dataset)
        model = SPop()
        model.fit(dataset)
        model.score(0, [])
        result = model.rank(0, history_items=[])
>       self.assertTrue((result[0] == [3, 2, 4, 1, 0, 5, 8, 7, 6]).all())
E       AssertionError: False is not true

tests/cornac/models/test_recommender.py:88: AssertionError

There might be some randomness in this test where it passes most of the time but fails rarely?

Investigate this failing case, I find that the ranking results of SPop as follows:

(array([3, 2, 4, 0, 1, 5, 8, 7, 6]), 
array([0.6923077 , 0.6923077 , 0.9230769 , 1., 0.7692308 , 0.3846154 , 0.07692308, 0.07692308, 0.07692308], dtype=float32))

We can see that there are some items having identical scores. Thus we need to rewrite to ensure the test case can pass in those cases. This will be fixed in another PR.

@qtuantruong qtuantruong merged commit 55e7f2e into master May 20, 2024
@qtuantruong qtuantruong deleted the 618-bug-trirank-documentation-xy branch May 20, 2024 17:44
@qtuantruong qtuantruong added docs Documentation (Readme, readthedocs) related and removed models New models, changes to models labels May 22, 2024
qtuantruong pushed a commit to qtuantruong/cornac that referenced this pull request Oct 25, 2025
qtuantruong pushed a commit to qtuantruong/cornac that referenced this pull request Oct 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation (Readme, readthedocs) related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Trirank documentation X&Y

2 participants