def test_gaps(self):
     '''
     should ignore [None, None] points
     '''
     X = fixtures.load('synthetic_gapped')  # Gaps added to microsaccade
     r = fixationmodel.fit(X)
     self.assertEqual(r['centroid'], [0.4, 0.4])
     self.assertAlmostEqual(r['mean_squared_error'], 3.68)
 def test_run(self):
     '''
     should run and give correct answers in trivial case
     '''
     X = fixtures.load('synthetic_fixation')
     r = fixationmodel.fit(X)
     self.assertEqual(r['centroid'], [0.0, 0.0])
     self.assertEqual(r['mean_squared_error'], 0.0)
 def test_centroid(self):
     '''
     should give correct answers in nontrivial case
     '''
     X = fixtures.load('synthetic_microsaccade')
     r = fixationmodel.fit(X)
     self.assertEqual(r['centroid'], [0.4, 0.4])
     self.assertAlmostEqual(r['mean_squared_error'], 3.68)
Ejemplo n.º 4
0
def extract_raw_features(pointlist):
    return {
        'saccade': saccademodel.fit(pointlist),
        'fixation': fixationmodel.fit(pointlist)
    }
def extract_raw_features(pointlist):
    return {
        'saccade': saccademodel.fit(pointlist),
        'fixation': fixationmodel.fit(pointlist)
    }