You can use this assignment in your class!
Mastery Progress(100.0%)
i

Cosine Similarity Practice

imgEducator’s Choice

You answeredJUST NOW
Python
You passed all test cases!
STDIN
[1, 2, 3]
[-1, -2, -3]
Expected STDOUT
-1.000
Your STDOUT
-1.000
STDIN
[1, 2, 3]
[1, 2, 3]
Expected STDOUT
1.000
Your STDOUT
1.000
STDIN
[0, 2, 0]
[1, 0, 3]
Expected STDOUT
0.000
Your STDOUT
0.000
STDIN
[33, 15, -20]
[22, 7, -13]
Expected STDOUT
0.995
Your STDOUT
0.995
STDIN
[36.2, -37.8]
[-67.3, -64.2]
Expected STDOUT
-0.002
Your STDOUT
-0.002
STDIN
[67, -43, 33, -96, 36]
[-3, -37, 42, 13, 11]
Expected STDOUT
0.245
Your STDOUT
0.245

Did you like this question?

(Voting helps us personalize your learning experience!)
imgInstructor solution
Instructor Alec KretchJAN. 24, 2021 AT 11:02 PMstarTop Answer
Python

Was this helpful?

(Voting helps us personalize your learning experience!)
imgCosine similarity formula
By Instructor Alec Kretch (May 5, 2021)

Was this helpful?

(Voting helps us personalize your learning experience!)
imgCosine similarity example clip

Was this helpful?

(Voting helps us personalize your learning experience!)
Think you've got it?
  • A.
  • B.
  • C.
  • D.

Was this helpful?

(Voting helps us personalize your learning experience!)

You may exit out of this review and return later without penalty.