Why should ordinal variables be considered for Euclidean distance?

Screen Link: https://app.dataquest.io/m/140/multivariate-k-nearest-neighbors/1/recap

The guidance says that
non-ordinal values (e.g. latitude or longitude)

  • ranking by Euclidean distance doesn’t make sense if all attributes aren’t ordinal

I am not able to understand , if the attribute is ordinal , how can we calculate euclidean distance (q1-p1). Please advise.

Hey.

Please review the first mission in the course, specifically this screen. We explain this there.

I hope this helps.

Hey Bruno,
thanks for your response.
Sorry, I did not make my question clear. I understand that the ordinal values are unique and have a direction but one cannot determine the difference. So when we have an ordinal value as one of the variables, how can we use it to calculate euclidean distance as (q1-p1) since this is difference ,which cannot be determined for ordinal variables as mentioned above.

You can use one-hot encoding for this. See for instance the Wikipedia articles Dummy variable and One-hot. You’ll learn more about this later in path.

1 Like