Is there a way to pass composite inputs into a CustomFactor? I mean, for example, for a CustomFactor like this:
class Scorer (CustomFactor):
window_length = 1
def compute(self, today, assets, out, data):
def score (x):
return x / (x + 10)
score_all = numpy.vectorize(score)
out[:] = score_all(data)
being able to do something like this:
poms = Scorer(inputs = [ operation_ratios.operation_margin + operation_ratios.gross_margin ])
Currently, doing that will spew out something like this:
TypeError: unsupported operand type(s) for +: 'BoundColumn' and 'BoundColumn'
Oh, and a little background: The reason I want to do it like this rather than just having a scorer(x) function which does the same thing is so I can apply a mask to the items being scored. I'm currently using a scorer(x) function for several scores and with that I am occassionally getting timeout errors.
Thoughts?
. Topher