Commit Graph

17 Commits

Author SHA1 Message Date
Jacob Schreiber 02c0029baa ENH gbt sparse support 2015-09-28 13:44:12 -07:00
Jacob Schreiber 442b49a5a3 ENH criterion file cleaned up 2015-09-22 00:03:31 -07:00
Olivier Grisel 91de280428 MAINT re-cythonize sklearn/tree/*.pyx 2015-09-11 16:27:09 +02:00
Jacob Schreiber 5978c0bbdf ENH split _tree.pyx into several files 2015-09-09 11:28:24 +02:00
Gilles Louppe 44d81a0ec3 FIX: add except* in Splitter.init definitions 2015-02-23 08:19:10 +01:00
Arnaud Joly ce8b214154 MAINT reduce amount of boiler code using standard C operations 2014-06-19 20:13:59 +02:00
Gilles Louppe da95ad8a65 FIX: Set correct impurity values in BestFirstBuilder 2014-04-10 20:27:37 +02:00
Arnaud Joly 84c3742cb3 ENH re-generate c file 2014-03-20 14:20:35 +01:00
Arnaud Joly e509724e7e ENH avoid trying to split on constant features for presort best splitter 2014-03-10 12:16:42 +01:00
Arnaud Joly 25e2c19573 FIX bug with BestSPlitter + ENH avoid searching for a split on constant features 2014-03-10 12:16:32 +01:00
Arnaud Joly 57f93fac16 ENH avoid splitting on constant features for best splitter 2014-03-10 12:16:22 +01:00
Arnaud Joly abaf100a65 WIP add n_constant_features argument 2014-03-10 12:15:58 +01:00
Lars Buitinck 7fc52ffdb4 BUG fix unchecked mallocs in trees
All mallocs should be checked now. Some notes for the next person to touch
this code, or do anything with malloc in Cython code:

* with gil: raise MemoryError() didn't work as expected, as a surrounding
  nogil block catches and logs the exception, then proceeds as if nothing
  happened.
* There were several opportunities for double free in the code. This is
  handled by letting the destructor handle the freeing.
* Similarly, constructors failed to set pointers to NULL so __dealloc__
  would try to free unitialized pointers.
* Out of memory might leave trees in an inconsistent state, but will not
  cause a double free. A subsequent successful fit should produce a
  consistent state, although I didn't test this.
* Replaced a free/calloc with a realloc; realloc(NULL, n) = malloc(n).
* free(NULL) is a harmless no-op per ISO C89.

Also performed an optimization: the pre-sort splitter was using size_t for
an array of booleans. unsigned char is faster and smaller.

Finally, fixed some cosmetic issues (long lines).
2014-01-11 15:44:44 +01:00
Gilles Louppe b3a9da908d Regenerate C files 2014-01-09 10:05:20 +01:00
Peter Prettenhofer dd680d6a2f malloc / realloc checks
correct rc values
2014-01-06 13:56:23 +01:00
Gilles Louppe fbab2cd5e2 COSMIT + FIX in _utils.pyx 2013-11-29 11:15:59 +01:00
Peter Prettenhofer 635505e544 moved data structures (Stack + Heap) to _utils
use impurity_improvement for choosing best split
2013-11-22 15:33:59 +01:00