Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add next-item pipeline #561

Merged
merged 23 commits into from
Dec 26, 2023
Merged

Add next-item pipeline #561

merged 23 commits into from
Dec 26, 2023

Conversation

hieuddo
Copy link
Member

@hieuddo hieuddo commented Dec 8, 2023

Description

  • add data.dataset.SequentialDataset to support new data formats:
    • "SIT": Session, Item, Timestamp
    • "SITJson": Session, Item, Timestamp, Json
    • "USIT": User, Session, Item, Timestamp
    • "USITJson": User, Session, Item, Timestamp, Json
  • add data.reader parser for listed formats
  • add eval_method.NextItemEvaluation for next-item evaluation
  • add models.SPop baseline model: session-based popular

Related Issues

#543

Todo

  • write tests for listed new data/reader/model
  • add next-item datasets and corresponding examples (examples done locally without local datasets)

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

cornac/data/reader.py Outdated Show resolved Hide resolved
cornac/data/reader.py Outdated Show resolved Hide resolved
cornac/data/reader.py Outdated Show resolved Hide resolved
cornac/data/reader.py Outdated Show resolved Hide resolved
cornac/data/reader.py Outdated Show resolved Hide resolved
@tqtg
Copy link
Member

tqtg commented Dec 9, 2023

@hieuddo @lthoang please take a look at some initial comments and see if they make sense. Also, can we have an example for the SPop baseline so at least we can do sanity check while making changes?

@hieuddo
Copy link
Member Author

hieuddo commented Dec 11, 2023

I added Pop and SPop models example with yoochoose dataset and obtained these results:

MRR NDCG@10 NDCG@50 Recall@10 Recall@50 Train (s) Test (s)
Pop 0.0011 0.0000 0.0012 0.0000 0.0061 0.1965 13.0280
SPop 0.2724 0.2860 0.2871 0.3290 0.3340 0.1968 13.1694

@tqtg
Copy link
Member

tqtg commented Dec 11, 2023

@hieuddo @lthoang are we planning to add some unit tests for the new changes?

@hieuddo
Copy link
Member Author

hieuddo commented Dec 12, 2023

@hieuddo @lthoang are we planning to add some unit tests for the new changes?

Yes. Unit tests are in todo list

@saghiles
Copy link
Member

General comment. I see some formatting changes. Let's stick to "black" formatting to remain consistent across the library.

@darrylong darrylong added the feature New feature/enhancement request label Dec 21, 2023
@tqtg
Copy link
Member

tqtg commented Dec 24, 2023

@hieuddo @lthoang this PR is getting very complicated to review. Let's not keep adding more features (e.g., iterators) to this until we need them for other models in the future PRs. If this is sufficient to run the SPop baseline and do evaluation, I would suggest to revise the current code carefully and merge this PR.

@lthoang
Copy link
Member

lthoang commented Dec 25, 2023

@hieuddo @lthoang this PR is getting very complicated to review. Let's not keep adding more features (e.g., iterators) to this until we need them for other models in the future PRs. If this is sufficient to run the SPop baseline and do evaluation, I would suggest to revise the current code carefully and merge this PR.

@tqtg I keep some iterators that i think should be standard enough for accessing data in sequence level and user level. The non-standard iterator (i.e., input-output iterators) has been removed from the current PR.
We already have enough components for supporting any standard next-item recommendation model atm. Please spend some time to review the source code and merge it when ready.

@tqtg
Copy link
Member

tqtg commented Dec 26, 2023

LGTM

@hieuddo hieuddo merged commit eabdd2d into PreferredAI:master Dec 26, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature/enhancement request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants