-
Notifications
You must be signed in to change notification settings - Fork 36
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
sasrec tests #193
base: experimental/sasrec
Are you sure you want to change the base?
sasrec tests #193
Conversation
rectools/models/sasrec.py
Outdated
Parameters | ||
---------- | ||
sessions: List[List[int]] | ||
User interaction sequences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User interaction sequences. | |
User sessions in the form of sequences of items ids. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one missed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
tests/models/test_sasrec.py
Outdated
from tests.testing_utils import assert_id_map_equal, assert_interactions_set_equal | ||
|
||
|
||
@pytest.mark.filterwarnings("ignore::pytorch_lightning.utilities.warnings.PossibleUserWarning") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add comments for this and the next line? (What the warnings are and why do we ignore them)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's quite obvious that it's a pytorch_lightning warning, could you add some details? And also some short explanation why we have this warning and why we ignore it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed filterwarnings
rectools/models/base.py
Outdated
@@ -194,6 +194,10 @@ def recommend( | |||
reco_warm_final = self._reco_to_external(reco_warm, dataset.user_id_map, dataset.item_id_map) | |||
reco_cold_final = self._reco_items_to_external(reco_cold, dataset.item_id_map) | |||
|
|||
reco_hot_final = self._adjust_reco_types(reco_hot_final, dataset.user_id_map.external_dtype, item_type) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's just pass it like dataset.item_id_map.external_dtype
just like we are doing for users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataset.item_id_map has type object after _custom_transform_dataset_u2i
rectools/models/sasrec.py
Outdated
Parameters | ||
---------- | ||
sessions: List[List[int]] | ||
User interaction sequences. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one missed
tests/models/test_sasrec.py
Outdated
# Ignore pytorch_lightning warnings | ||
@pytest.mark.filterwarnings("ignore::pytorch_lightning.utilities.warnings.PossibleUserWarning") | ||
# Ignore non-empty checkpoint directory warnings, SASRec user warnings | ||
@pytest.mark.filterwarnings("ignore::UserWarning") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just change to on_supported_targets=ignore
where you don't want the warnings to be received from recommend
method. Let's drop this filtering
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
added sasrec test