Skip to content

Fallback cold #96

Merged
merged 26 commits into from
Feb 17, 2022
Merged

Fallback cold #96

merged 26 commits into from
Feb 17, 2022

Conversation

Darel13712
Copy link
Contributor

No description provided.

@monkey0head
Copy link
Contributor

max_user max_item is now real maximal idx of user/item (no + 1)


@property
def max_item(self) -> int:
"""
:returns: number of items the model was trained on
:returns: maximum item_idx presented in the models' train dataset
Copy link
Collaborator

Choose a reason for hiding this comment

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

apostrof

@@ -128,17 +128,17 @@ def _fit(
pandas_log["relevance"],
(pandas_log["user_idx"], pandas_log["item_idx"]),
),
shape=(self.max_user, self.max_item),
shape=(self.max_user + 1, self.max_item + 1),
Copy link
Collaborator

Choose a reason for hiding this comment

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

pls add one inside max_user/item (possible you need rename this property to another name)

@monkey0head
Copy link
Contributor

  • max_user/item properties renamed to _user_dim/_item_dim private properties.
  • 4 new baserec attributes added to store num users/items and user/item dimensions as calling property and calculating each time is computationally expensive
  • as we do not have an opportunity to save attributes defined outside init, related properties were left to check the attribute existence and calculate and set it if it is absent.
  • caching added for fit_users and fit_items

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants