Skip to content

Instantly share code, notes, and snippets.

@prateekjoshi565
Created July 28, 2019 18:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prateekjoshi565/570aaf9a4ef7d4381792a48a5e281594 to your computer and use it in GitHub Desktop.
Save prateekjoshi565/570aaf9a4ef7d4381792a48a5e281594 to your computer and use it in GitHub Desktop.
def aggregate_vectors(products):
product_vec = []
for i in products:
try:
product_vec.append(model[i])
except KeyError:
continue
return np.mean(product_vec, axis=0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment