I Have a N x D dimensional features, which I need to rank according to their distance to a 1 x D dimensional vector. Any fast way to implement that in python without recursively apply argmin?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Something really simple is Squared Euclidean Distance, and it’s implementation would be like:
Where
Fare the features andtthe target vector. Thus the ranking would be:However if you are able to describe more on your case, there might exist more suitable measures, like Mahalanobis distance.