# Functions to generate the weights of users and items. def user_weight(user_id): """ Function to return weight for user_id.""" return u_w[all_users.index(user_id)] def user_weights(list_ids): """ function to return array of weights for list of user_ids.""" return np.array([u_w[all_users.index(i)] for i in list_ids]) def item_weight(name): """ Function to return weight for venue name.""" return i_w[all_venues.index(name)] def item_weights(list_ids): """ Function to return array of weights for list of venue names.""" return np.array([i_w[all_venues.index(i)] for i in list_ids])