def total_sum_of_squares(y): """the total squared variation of y_i's from their mean""" return sum(v ** 2 for v in de_mean(y))
def total_sum_of_squares(y: Vector) -> float: return sum(v**2 for v in de_mean(y))
def total_sum_of_squares(y): """the total squared variation of y_i's form their mean""" return sum(v ** 2 for v in de_mean(y))
def total_sum_of_squares(y): return sum(v**2 for v in de_mean(y))
def total_sum_of_squares(vector): return sum(m ** 2 for m in de_mean(vector))
def test_de_mean(self): self.assertEqual([-3, -2, -1, 0, 0, 6], statistics.de_mean([1, 2, 3, 4, 4, 10])) # mean is 4 self.assertEqual([0], statistics.de_mean([1])) self.assertEqual([], statistics.de_mean([]))