The version of ChiMerge described here has a compu-
tational complexity, in terms of the number of times
that the x2 function is called, of 0(n2), where n is
the number of examples2. However, implementation
of some simple optimizations can reduce the complex-
ity to O(n logn). One source of increased speed is to
be more aggressive about merging when constructing
the initial list of intervals.
In addition, several pairs of
intervals, not near each other, could be merged on each
iteration.
The x2 values could also be cached rather
than re-computed each iteration for those intervals not
affected.
However, the lower bound of ChiMerge is
O(n logn)-the complexity of sorting the examples in
the initial step of the algorithm-unless some means
can be devised to eliminate this step.