October 2018
Intermediate to advanced
472 pages
10h 57m
English
To process the query, we find out its similarity with other questions. We do this by taking a dot product of the training data matrix with a transpose of the query data:
XX_similarity=np.dot(X_train.todense(), X_query.transpose().todense())
Now, we take out the similarity between the query and train data as a list:
XX_sim_scores= np.array(XX_similarity).flatten().tolist()
Read now
Unlock full access