Пример #1
0
 def test_f3(self):
     src = extract_f3(self.gb).sort_values(['Session ID', 'Item ID'])
     dst = pd.DataFrame(np.array(
         [[5, 214530776, 3], [10, 214820942, 1], [10, 214826810, 1],
          [15, 214555903, 1], [15, 214547255, 2], [20, 214829282, 2],
          [20, 214718203, 1], [20, 214819552, 1], [25, 214836761, 1],
          [25, 214839313, 5], [30, 214820201, 2]],
         dtype=np.int32),
                        columns=['Session ID', 'Item ID', 'Counts'
                                 ]).sort_values(['Session ID', 'Item ID'])
     np.testing.assert_array_equal(src, dst, 'Incorrect extraction of F3')
Пример #2
0
 def test_f3(self):
     src = extract_f3(self.gb).sort_values(['Session ID', 'Item ID'])
     dst = pd.DataFrame(np.array([
         [5, 214530776, 3],
         [10, 214820942, 1],
         [10, 214826810, 1],
         [15, 214555903, 1],
         [15, 214547255, 2],
         [20, 214829282, 2],
         [20, 214718203, 1],
         [20, 214819552, 1],
         [25, 214836761, 1],
         [25, 214839313, 5],
         [30, 214820201, 2]],
         dtype=np.int32),
         columns=['Session ID', 'Item ID', 'Counts']
     ).sort_values(['Session ID', 'Item ID'])
     np.testing.assert_array_equal(src, dst, 'Incorrect extraction of F3')
Пример #3
0
 def test_p6(self):
     src = extract_p6(extract_f3(self.gb))
     dst = np.array([3, 1, 2, 2, 5, 2])
     np.testing.assert_array_equal(src, dst, 'Incorrect extraction of P6')
Пример #4
0
 def test_p2(self):
     src = extract_p2(extract_f3(self.gb))
     dst = np.array([3, 1, 1.5, 4.0 / 3.0, 3, 2])
     np.testing.assert_array_equal(src, dst, 'Incorrect extraction of P2')
Пример #5
0
 def test_p2(self):
     src = extract_p2(extract_f3(self.gb))
     dst = np.array([3, 1, 1.5, 4.0 / 3.0, 3, 2])
     np.testing.assert_array_equal(src, dst, 'Incorrect extraction of P2')
Пример #6
0
 def test_p6(self):
     src = extract_p6(extract_f3(self.gb))
     dst = np.array([3, 1, 2, 2, 5, 2])
     np.testing.assert_array_equal(src, dst, 'Incorrect extraction of P6')