Ejemplo n.º 1
0
 def test_moment(self):
     # Returns 0.0 (1st central moment = 0.0).
     v = metrics.moment([1,2,3,4,5], k=1)
     self.assertEqual(v, 0.0)
     # Returns 2.0 (2nd central moment = population variance).
     v = metrics.moment([1,2,3,4,5], k=2)
     self.assertEqual(v, 2.0)
Ejemplo n.º 2
0
 def test_moment(self):
     # Assert 0.0 (1st central moment = 0.0).
     v = metrics.moment([1,2,3,4,5], n=1)
     self.assertEqual(v, 0.0)
     # Assert 2.0 (2nd central moment = population variance).
     v = metrics.moment([1,2,3,4,5], n=2)
     self.assertEqual(v, 2.0)
     print("pattern.metrics.moment()")
Ejemplo n.º 3
0
 def test_moment(self):
     # Assert 0.0 (1st central moment = 0.0).
     v = metrics.moment([1, 2, 3, 4, 5], n=1)
     self.assertEqual(v, 0.0)
     # Assert 2.0 (2nd central moment = population variance).
     v = metrics.moment([1, 2, 3, 4, 5], n=2)
     self.assertEqual(v, 2.0)
     print("pattern.metrics.moment()")