Skip to content

Support individual user rows when explaining ALS recommendations - #765

Open
HKUCaoJinrui wants to merge 1 commit into
benfred:mainfrom
HKUCaoJinrui:codex/als-explain-user-row
Open

HKUCaoJinrui wants to merge 1 commit into
benfred:mainfrom
HKUCaoJinrui:codex/als-explain-user-row

Conversation

@HKUCaoJinrui

Copy link
Copy Markdown

Fixes #701.

recommend accepts a single user's interaction row. Passing that same row to explain raised IndexError for a nonzero user ID because explain indexed the one-row input by the global ID. Use its first row for both the weight calculation and the item contributions. A caller passing the full interaction matrix still gets row userid.

Added regression coverage using real CPU ALS training for both fresh and cached weights. Both cases failed on the original code. The full suite passed on Windows (166 passed, 54 skipped). A separate comparison found matching scores and contributions for all 336 row/full-matrix cases tested. Ruff formatting and lint passed on the two changed files.

Developed and tested with Codex assistance.

This branch has not been deployed

No deployments
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.

als explain method bug

1 participant