Hi there,
I'm very excited about using Augustus to run PMML models in Python. My PMML models use DefineFunction and I'm running into problems. I've modified the add two numbers example like this:
<Header/>
<DataDictionary>
<DataField name="x" dataType="double" optype="continuous"/>
<DataField name="y" dataType="double" optype="continuous"/>
</DataDictionary>
<TransformationDictionary>
<DefineFunction dataType="float" optype="continuous" name="add">
<ParameterField optype="continuous" name="first"></ParameterField>
<ParameterField optype="continuous" name="second"></ParameterField>
<Apply function="+" invalidValueTreatment="returnInvalid">
<FieldRef field="first"></FieldRef>
<FieldRef field="second"></FieldRef>
</Apply>
</DefineFunction>
<DerivedField name="z" dataType="double" optype="continuous">
<Apply function="add">
<FieldRef field="x"/>
<FieldRef field="y"/>
</Apply>
</DerivedField>
</TransformationDictionary>
</PMML>
And this is my script for running it:
from resources import add_two_numbers_file
from augustus.strict import modelLoader
# Load model
with open(add_two_numbers_file, 'r') as model_file:
model_str = model_file.read()
model = modelLoader.loadXml(model_str)
# Run model
print model.calc({'x':[1,2,3],'y':[4,5,6]}).look()
However, I get an error:
AttributeError: 'DefineFunction' object has no attribute '_setupCalculate'
I'm using the latest trunk and am able to run the unmodified example (without a DefineFunction) without a problem. Any help would be much appreciated.
Best,
Jason