scikit-learn/scikit-learn — pull request #3293 by jnothman (2014-06-19 07:17:54+00:00)
Title: [MRG] Factor out split data as struct in Tree splitters and builders

This uses a struct to store 6 C variables that get passed by tree builders into splitters, where they are duplicated for the current and best candidate. Copying `current` to `best` is then a one-liner. The refactor hence saves >300 lines of C code.

This changes the not-quite-public `Splitter.node_split` interface, so we may want to be conservative about it.

I originally made part of this patch as a contribution to #3173, where the code was duplicated another two times, but this version is a bit more ambitious in modifying the `node_split` interface and the tree builder, and thought warranted separate review.