When all attributes result in the same fitness score, the code continuously chooses to partition on the first attribute. As you can see in the example above, this does nothing to partition the data.
While it may not be the provably best approach, this pull request solves the problem by checking if all attributes result in the same fitness score, and if so, choosing a best attribute randomly.
The preceding sample causes infinite recursion.
When all attributes result in the same fitness score, the code continuously chooses to partition on the first attribute. As you can see in the example above, this does nothing to partition the data.
While it may not be the provably best approach, this pull request solves the problem by checking if all attributes result in the same fitness score, and if so, choosing a best attribute randomly.