Commit Graph

153 Commits

Author SHA1 Message Date
trevorstephens 2b24ccefa0 parameter validation checks & tests for errors 2015-01-03 13:15:42 -08:00
trevorstephens 085d677ea2 add class_weight to trees, expand tests & minor refactor 2014-12-22 16:50:58 -08:00
Arnaud Joly 089d2f7779 TST add a toy test for min_weight_samples_leaf 2014-11-26 11:03:37 +01:00
Arnaud Joly 0bc8a986d0 FIX+ENH add min_weight_fraction_split support for sparse splitter 2014-11-06 13:58:28 +01:00
Arnaud Joly c03c01a504 ENH Bring sparse input support to tree-based methods
Author:     Arnaud Joly <arnaud.v.joly@gmail.com>
            Fares Hedayati <fares.hedayati@gmail.com>
2014-11-06 13:58:28 +01:00
Lars Buitinck 2181f7c3ec TST more robust test for MemoryError from Tree._resize
Fixes #3686.
2014-09-22 16:59:04 +02:00
Lars Buitinck 5335539d95 FIX propagate MemoryError from Tree._resize
Fixes #3684. "except *" declaration was ignored because it was missing
from the .pxd file.
2014-09-22 14:22:46 +02:00
Noel Dawe 79d965afcc min_weight_fraction: comments and pep8 2014-07-02 11:47:32 +02:00
Noel Dawe 39f831d466 utils.testing: add assert_greater_equal and assert_less_equal 2014-07-02 11:47:32 +02:00
Noel Dawe d72f958596 min_weight_fraction_leaf and min_samples_leaf: test both best-first and depth-first tree building 2014-07-02 11:47:31 +02:00
Noel Dawe 7e9c093585 tree: add min_weight_fraction_leaf 2014-07-02 11:47:31 +02:00
Arnaud Joly ad3156dd7c TST reduce max_depth for numerical stability 2014-06-08 17:56:20 +02:00
Matthias Feurer bb0689f525 ENH: make trees work with very small max_features.
Trees do no longer fail if int(max_features*n_features) == 0, but use
max_features=1 if the max_features paramater was larger than 0.0

Fixes #3171.
2014-06-01 16:34:37 +02:00
Lars Buitinck 65bb024f95 FIX MemoryError raising in trees (+test)
I got this wrong all along: Cython functions that don't return Python
objects need an "except" clause to actually propagate exceptions (spotted
by @GaelVaroquaux, @arjoly).

Simplified memory management and unified error messages by safe_realloc.
2014-05-05 19:44:31 +02:00
Gilles Louppe 61dd4b4be9 FIX: weight impurity improvement by the size of the node 2014-04-12 10:33:04 +02:00
Gilles Louppe da95ad8a65 FIX: Set correct impurity values in BestFirstBuilder 2014-04-10 20:27:37 +02:00
Arnaud Joly 269afc10fd FIX numerical stability issues on 32 bit platform
The gini index and the mean square error (variance) might differ due
to numerical instability. Since those instabilities mainly occurs at
high tree depth, we restrict the maximal depth.
2014-04-04 10:15:15 +02:00
Lars Buitinck b97fb3c5fc MAINT drop support for NumPy < 1.6.1 2014-03-02 20:13:57 +01:00
Lars Buitinck 5f027f3e6d FIX error message from trees for large inputs
Fixes #2809 (hopefully).
2014-02-15 17:22:16 +01:00
Arnaud Joly e368d9a53e TST add tests with constant features 2014-02-13 11:29:17 +01:00
Joel Nothman e7e7133912 ENH/FIX Change Tree underlying data structure
* avoid segfault (#2726) by setting base on numpy arrays
* A struct array for tree nodes and values array (size indeterminate at
compile time) are the only underlying structure, so each node is locally
grouped memory, and joblib dumps will save only two numpy files per
tree.
* predict() uses the value array's take method, reducing code repetition
2014-01-16 09:32:16 +11:00
Arnaud Joly 260bdb9d9e TST Gini is equivalent to mse in binary classification 2014-01-13 17:13:48 +01:00
Lars Buitinck 5847006f11 COSMIT get rid of deprecation warning in tree tests 2014-01-11 12:51:15 +01:00
Peter Prettenhofer 834b3754c2 uses raises instead of with assert_raises - apparently doesn't work on python3 nose version. 2014-01-08 16:30:45 +01:00
Peter Prettenhofer 792a09c0d7 better test coverage in tree module 2014-01-08 14:14:06 +01:00
Peter Prettenhofer 73c7de32e2 cosmit: better exception
remove troublesome 32bit test
2014-01-08 12:10:05 +01:00
Peter Prettenhofer 1b8ea52741 max_leaf_nodes has precedence over max_depth if the former is not None. 2013-12-02 20:13:57 +01:00
Gilles Louppe 722afb2cdb TEST: disable test_32bit_equality 2013-11-29 14:12:02 +01:00
Peter Prettenhofer 9f23eb76f4 update test (slight changes in tree output because of removal of EPSILON insensitive checks) 2013-11-22 17:56:09 +01:00
Peter Prettenhofer 3f0c3f076c check value of max_leaf_nodes 2013-11-03 16:07:57 +02:00
Peter Prettenhofer 173f6e477b fix: test renamed and check only on nr of leafs. 2013-11-03 12:50:45 +02:00
Peter Prettenhofer e9cea77bd8 PriorityQueue for best-first tree growing
max_leaf_nodes instead of complete parameter
2013-11-03 09:40:24 +02:00
Peter Prettenhofer d7e5802037 add tests for complete 2013-11-02 11:36:19 +02:00
Olivier Grisel 7d9984b995 Merge pull request #2442 from glouppe/tree-shuffle
[MRG] Trees: random features selection is biased
2013-09-24 13:38:37 -07:00
Gilles Louppe f92c734970 TEST: add tests for splitter="presort-best" 2013-09-23 09:43:22 +02:00
Gilles Louppe 2d16aee90e FIX: use XorShift random number generator 2013-09-22 19:36:09 +02:00
Gilles Louppe 9c07ca32b9 FIX: module RAND_R_MAX 2013-09-22 19:35:39 +02:00
Gilles Louppe dc36bf3dc0 FIX: random number generator
FIX: address @larsmans + @ogrisel comments

ENH: add INT32_t type

ENH: rename INT32_t to UINT32_t

FIX: modulo RAND_R_MAX+1

FIX: broken tests
2013-09-22 19:35:18 +02:00
Arnaud Joly 7551a82e89 ENH reduce memory overhead of storing tree ensemble 2013-09-12 14:25:49 +02:00
balu 33507a1f3d fix line endings and visual indents 2013-08-31 12:25:15 +05:30
Nelle Varoquaux e3a764db5e FIX backward compatibility was broken 2013-07-29 03:06:58 +02:00
Peter Prettenhofer 572600b75b added 32bit 64bit equality test case 2013-07-27 13:45:33 +02:00
Andreas Mueller e488704849 COSMIT pep8 2013-07-23 15:17:32 +02:00
Arnaud Joly 73e24d2193 TST remove unused tests 2013-07-22 17:43:14 +02:00
Arnaud Joly 5fafad9274 TST max_features for more tree estimators 2013-07-22 17:43:14 +02:00
Arnaud Joly a9354a6b19 MAINT Set random_state, modernize tests 2013-07-22 17:43:14 +02:00
Gilles Louppe 0c6c7731bc FIX: remove debug message 2013-07-22 14:23:09 +02:00
Gilles Louppe 8f9f2e41bd WIP: better check inputs 2013-07-22 12:20:02 +02:00
Gilles Louppe 4e4316c022 TEST: add test_memory_layout 2013-07-22 12:20:02 +02:00
Gilles Louppe 3f540dafa6 WIP: small optimizations 2013-07-22 12:19:58 +02:00