Словарь Python Dot Product
dot_product = sum(dict_1[key]*dict_2.get(key, 0) for key in dict_1)
DS in Training
dot_product = sum(dict_1[key]*dict_2.get(key, 0) for key in dict_1)