'Calling function for factor instance.'

def get_columns(self, *args, **kw):

    v = self.namespace[self._name]
    while True:
        if callable(v):
            if isinstance(v, (Term, Formula)):
                v = copy.copy(v)
                v.namespace = self.namespace
            v = v(*args, **kw)
        else:
            break
    n = len(v)
    if self.ordinal:
        col = [float(self.keys.index(v[i])) for i in range(n)]
        return np.array(col)
    else:
        value = []
        for key in self.keys:
            col = [float((v[i] == key)) for i in range(n)]
            value.append(col)
        return np.array(value)
