Skip to content

Fix sorting order in aspect score for Companion, ComparERSub#684

Merged
lthoang merged 1 commit intoPreferredAI:masterfrom
MacchiatoCreamCheese:fix-reverse-order-companion-comparer
Mar 29, 2026
Merged

Fix sorting order in aspect score for Companion, ComparERSub#684
lthoang merged 1 commit intoPreferredAI:masterfrom
MacchiatoCreamCheese:fix-reverse-order-companion-comparer

Conversation

@MacchiatoCreamCheese
Copy link
Copy Markdown
Contributor

Description

Bug fix: top-aspect selection in Companion and ComparER ranking

Both models used argsort(axis=1)[::-1] to select top aspects for the ranking score, intending to sort aspects descending. However, [::-1] on a 2D array reverses rows (items), not columns (aspects). The result was that each item received aspect indices from a different item's ascending sort — selecting the wrong item's worst aspects instead of its own best aspects.

Fix: change [::-1] to [:, ::-1] in recom_companion.pyx and recom_comparer_sub.pyx.

Related Issues

N/A

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).

@qtuantruong qtuantruong requested a review from lthoang March 28, 2026 21:50
@lthoang lthoang changed the title fix sorting order in aspect score for Companion, ComparERSub Fix sorting order in aspect score for Companion, ComparERSub Mar 29, 2026
Copy link
Copy Markdown
Member

@lthoang lthoang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@lthoang lthoang merged commit a995589 into PreferredAI:master Mar 29, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants