def test_random(self):
        fractions = self.__class__.fractions
        data = self.__class__.data
        rows = len(data[USER])
        for fraction in fractions:
            train, test = testfm.split.holdoutByRandom(data, fraction,
                                                       clean_not_seen=False)
            i = int(rows * fraction)
            print 'fraction ', fraction, '   ',

            print((train.shape[0], test.shape[0]), (i, i-rows))
            # Test if the number of elements in training correspond to the
            # "fraction" of the data and the test correspond to the rest
            assert((train.shape[0], test.shape[0]) == (i, rows-i)), \
                "Number of rows expected is wrong"

            # Test if every element in the test plus train are in the full data
            # set.
            assert_frame_equal(
                pd.concat((train, test)).sort([DATE]).set_index([DATE]),
                data.sort([DATE]).set_index([DATE]))

            print 'passed'
dataset/ETHPy150Open grafos-ml/test.fm/src/tests/test_fm.py/TestSplitters.test_random/swapped operands of `-`