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))
コード例 #2
0
def total_sum_of_squares(y: Vector) -> float:
    return sum(v**2 for v in de_mean(y))
コード例 #3
0
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))
コード例 #4
0
def total_sum_of_squares(y):
    return sum(v**2 for v in de_mean(y))
コード例 #5
0
def total_sum_of_squares(vector):
    return sum(m ** 2 for m in de_mean(vector))
コード例 #6
0
 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([]))
コード例 #7
0
 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([]))