The calculation of avgce in the dforest test routines does not match what the algorithms, themselves, in the dforest module, do. Therefore, some of the dforest tests actually fail, even though they appear to pass.
Your test routines falsely report success, because in your ae_set_error_flag(), which sets the negative of a flag, you treat (A <= B) and (A > B); (A >= B) and (A < B) as negatives of one another, which they are not when A or B is NAN or INFINITY. So, a failure may pass through unseen, when A or B are NAN or INFINITY. This is what happens here.
The problem is removed by changing the calculation of avgce in test_c so that it matches how dforest module calculates avgce.
|