(col_x, bit_mapping, n_values)
return mapping[:-1], mapping[col_x.astype(np.int16)]
Return mapping and branches corresponding to column x

        Args:
            col_x (np.ndarray): data in x-column
            bit_mapping (int): bitmask that specifies which attribute values
                go to the left (0) and right (1) branch
            n_values (int): the number of attribute values

        Returns:
            A tuple of two numpy array: branch indices corresponding to
            attribute values and to data instances
Return mapping and branches corresponding to column x
Return mapping and branches corresponding to column x
def branches_from_mapping(col_x, bit_mapping, n_values):
        """
        Return mapping and branches corresponding to column x

        Args:
            col_x (np.ndarray): data in x-column
            bit_mapping (int): bitmask that specifies which attribute values
                go to the left (0) and right (1) branch
            n_values (int): the number of attribute values

        Returns:
            A tuple of two numpy array: branch indices corresponding to
            attribute values and to data instances
        """
        mapping = np.array(
            [int(x)
             for x in reversed("{:>0{}b}".format(bit_mapping, n_values))] +
            [-1], dtype=np.int16)
        col_x = col_x.flatten()  # also ensures copy
        col_x[np.isnan(col_x)] = n_values
        return mapping[:-1], mapping[col_x.astype(np.int16)]
def branches_from_mapping ( col_x , bit_mapping , n_values ) : mapping = np . array ( [ int ( x ) for x in reversed ( "{:>0{}b}" . format ( bit_mapping , n_values ) ) ] + [ - 1 ] , dtype = np . int16 ) col_x = col_x . flatten ( ) # also ensures copy col_x [ np . isnan ( col_x ) ] = n_values return mapping [ : - 1 ] , mapping [ col_x . astype ( np . int16 ) ]