Options

"Getting error msg: Wrong argument types for singular function gensym13:=exp(id)."

keithkeith Member Posts: 157 Maven
edited May 2019 in Help
Inside a FeatureGeneration node, I am trying to compute a probability from a log-odds value for both a prediction value and a label value.  For the prediction is it working fine.  For the label, I am getting the error message:

Wrong argument types for singular function gensym13:=exp(id).

This is being done inside a MultipleLabelIterator operator.  The label for each run is renamed to a static name so I can perform the mathematical operations on it (a workaround for not being able to use macros inside computations).  The relevant excerpt is:

            <operator name="Rename actual column" class="ChangeAttributeName">
                <parameter key="new_name" value="actual_val"/>
                <parameter key="old_name" value="label_%{a}"/>
            </operator>
            <operator name="FeatureGeneration" class="FeatureGeneration" breakpoints="after">
                <list key="functions">
                  <parameter key="this_is_a_new_attrib" value="exp(actual_val)"/>
                </list>
                <parameter key="keep_all" value="true"/>
            </operator>
The values in the data table after executing these operators appear to be the exponentiation of (row number - 1):

1
2.718
7.389
20.086
54.598
...

But as mentioned, the corresponding near-identical code for calculations on the predictions works fine:

            <operator name="Rename prediction column" class="ChangeAttributeName">
                <parameter key="new_name" value="predict_val"/>
                <parameter key="old_name" value="prediction(label_%{a})"/>
            </operator>
            <operator name="Calculate Predicted Probability" class="FeatureGeneration">
                <list key="functions">
                  <parameter key="pred_odds" value="exp(predict_val)"/>
                </list>
                <parameter key="keep_all" value="true"/>
            </operator>
Also of interest, the value type for this this_is_a_new_attrib is "numeric" whereas both the source values of predict_val and actual_val as well as the correctly computed pred_odds column are "real".

For now, I'm going to workaround this by computing the values outside the MultipleLabelIterator loop, and before I change the roles to label1, label2, label3, as it seems (at the moment) to work properly there.  But I'd be really curious to know why it isn't working as I was attempting it above.

Also, I am running the latest CVS version of RM as of Monday, not the public 4.2 release.

Thanks,
Keith
Tagged:
Sign In or Register to comment.