-
Notifications
You must be signed in to change notification settings - Fork 99
Open
Labels
lectureQuestions and comments about lecturesQuestions and comments about lectures
Description
For 02/03 lecture, I'm not sure why we need to have this second line in euclidean function? Thank you.
def euclidean(x1: Dict[str, float], x2: Dict[str, float]) -> float:
t = sum(((s1 - x2.get(term, 0)) ** 2 for term, s1 in x1.items()))
t += sum((s2 ** 2 for term, s2 in x2.items() if term not in x1))
return t
Metadata
Metadata
Labels
lectureQuestions and comments about lecturesQuestions and comments about lectures