Skip to content

user-user or item-item similarity scores #907

Answered by gbolmier
victusfate asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for the feedback @victusfate, this is an interesting use case! Indeed we don't support it right now. Latent factors are stored as dictionaries of numpy arrays in facto.FMRegressor, so latent vectors are accessed explicitly: model.regressor.steps['FMRegressor'].latents['Bob'].

We can use the internal math module to perform a dot product between two users:

def dot(x: dict, y: dict):

But this would be slow for many comparisons compared to vectorization. Maybe you could convert the dictionary of numpy arrays (or a subset of it) to one numpy array and use vectorization if speed is important to you.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@victusfate
Comment options

@gbolmier
Comment options

@victusfate
Comment options

@victusfate
Comment options

Answer selected by victusfate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants