def _indices(self, x):
        ''' A helper generator that yields the indices in x

            The purpose of this generator is to make the following
            code a bit cleaner when doing feature interaction.
        '''

        # first yield index of the bias term
        yield 0

        D = self.D
        # then yield the normal indices
        for feat in x:
            index = abs(hash(feat)) % D
            yield index
dataset/ETHPy150Open infinitezxc/kaggle-avazu/script/ftrl_2.py/ftrl_proximal._indices/original