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

transform interface #373

Closed
inkrement opened this issue Jul 21, 2020 · 1 comment
Closed

transform interface #373

inkrement opened this issue Jul 21, 2020 · 1 comment

Comments

@inkrement
Copy link
Contributor

inkrement commented Jul 21, 2020

Hi, have you planned a transform interface? Would be great if one can infer the item matrix (given latent factors/user matrix) or vice versa. I am not sure how to handle the item-bias terms, but I guess they are also optimized (or assumed to be zero?!).

@benfred
Copy link
Owner

benfred commented Jan 25, 2022

There is a bit of discussion about this happening here #467 - but in the last commit there we've added support for calculating the item matrix given a fixed user matrix (and vice versa).

As an example given a user_items sparse matrix containing interactions, and a existing_item_factors dense matrix containing precalculated item factors:

# Train an ALS model with pre-existing item factors, but calculating user factors
model = AlternatingLeastSquares()
model.item_factors = existing_item_factors
userids = np.arange(user_items.shape[0])
model.partial_fit_users(userids, user_items)

Going to close this - but please let me know if this is what you're looking for here

@benfred benfred closed this as completed Jan 25, 2022
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

No branches or pull requests

2 participants