post posts[iif post==new_postcontinue post_vec x_train getrow(id dist(post_vecnew_post_vecprint "==post % with dist= % "%(idpostif <best_distbest_dist best_i print("best post is % with dist= "%(best_ibest_dist)==post with dist= this is toy post about machine learning actuallyit contains not much interesting stuff ==post with dist= imaging databases provide storage capabilities ==post with dist= most imaging databases safe images permanently ==post with dist= imaging databases store data ==post with dist= imaging databases store data imaging databases store data imaging databases store data best post is with dist= congratulationswe have our first similarity measurement post is most dissimilar from our new post quite understandablyit does not have single word in common with the new post we can also understand that post is very similar to the new postbut not to the winneras it contains one word more than post that is not contained in the new post looking at posts and howeverthe picture is not so clear any more post is the same as post duplicated three times soit should also be of the same similarity to the new post as post printing the corresponding feature vectors explains the reasonprint(x_train getrow( toarray()[[ ]print(x_train getrow( toarray()[[ ]obviouslyusing only the counts of the raw words is too simple we will have to normalize them to get vectors of unit length