annena
June 25, 2022, 4:30am
1
Hi everyone, below is my approach to this question. Could anyone help to point out what is wrong with this approach? The correct answer is Turkey.
Compute (USA - Washington) + Ankara = (5 6) - (10 5) + (9 1) = (4 2)
Compute Euclidean distance from (4 2) to all other countries. From this, I chose Japan to be the answer because its Euclidean distance is 1 which is smallest.
Agreed. I was just going to post the same. There is an error in the quiz, correct answer is Japan.
Hi @annena
Please take a look at this answer (also the thread has more clarifications about the subject):
Hi, @Jack_Changfan .
The question is made of two parts:
What country? - (for that use cosine similarity: Turkey 0.9899 vs Japan 0.9839)
What distance? - (Euclidean distance: Turkey 1.41 vs Japan 1)
# country = Ankara(9,1) - Washington(10,5) + USA(5,6) = (4, 2)
# Cosine similarity: country (4, 2); Turkey(3, 1) = 0.9899
(4*3 + 2*1) / ((4**2 + 2**2)**0.5 * (3**2 + 1**2)**0.5)
# Cosine similarity: country (4, 2); Japan(4, 3) = 0.9839
(4*4 + 2*3) / ((4**2 + 2**2)**0.5 * (4**2 + 3**2)**…
Kiril
July 11, 2022, 8:30pm
4
So all you saying is ‘Yes if you use ecludian distance then Ankara is capital of Japan, but if you use cosine similarity Ankara is the capital of Turkey’.
Why didn’t you choose data that fit both methods to avoid this misunderstanding.
2 Likes
Hi @Kiril
Yes, you are correct, the question should be more explicit about which method to use. The issue is noted and submitted. Thank you!
Problem is still there. I just hit the same thing. I also chose Japan.