Commit Graph

178 Commits

Author SHA1 Message Date
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
Jeffrey Blackburne 21cf29cbe7 Fixed unit test in sklearn/tree/tests/test_tree.py. 2015-12-08 19:12:46 -08:00
yelite fea218e5cf In tree, min_samples_split and min_samples_leaf now accept float number as percentage. 2015-10-24 23:18:52 +02:00
Graham Clenaghan f69f895eee remove _balance_weights 2015-10-23 23:18:29 -07:00
Alexandre Gramfort efb0179f7f Merge pull request #5560 from arjoly/serialization-bug-tree
[MRG+1]FIX serialization bug in the implementation of the pickle protocol
2015-10-23 18:20:18 +02:00
Arnaud Joly 409c888aed Raise appropriate error if y is sparse 2015-10-23 17:28:07 +02:00
Arnaud Joly d53772d4a2 FIX serialization bug in the implementation of the pickle protocol 2015-10-23 15:56:27 +02:00
Arnaud Joly be21b6a5b0 Add an hardcoded test 2015-10-21 17:05:56 +02:00
Arnaud Joly bc02bd5243 ENH rename decision_paths to decision_path 2015-10-21 17:05:56 +02:00
Arnaud Joly f6d605ff96 Implement decision path in tree 2015-10-21 17:05:55 +02:00
Raghav R V e3afc0e8c9 MAINT move custom error/warning classes into sklearn.exceptions
ENH NonBLASDotWarning -> EfficiencyWarning; Improve error message
DOC Add exceptions module to modules/classes.rst
MAINT Move ConvergenceWarning, UndefinedMetricWarning et al into exceptions
MAINT Remove ChangedBehaviorWarning from base
DOC/FIX Improve DataConversionWarning's docstring
2015-10-19 22:35:35 +02:00
MechCoder 5a0db1717a 1. Added parameter prefit to pass in a fitted estimator.
2. Use assert_warns instead of catch_warnings
3. Remove depracation warnings in common tests.
2015-10-09 01:57:36 -04:00
MechCoder 2416e2aee6 Catch filters instead of removing the tests 2015-10-05 11:24:02 -04:00
Jacob Schreiber 02c0029baa ENH gbt sparse support 2015-09-28 13:44:12 -07:00
Gilles Louppe 25dbb155a6 TEST: stronger tests for variable importances 2015-09-12 15:18:51 +02:00
Vighnesh Birodkar 2f099334f9 MAINT deprecate 1d input arrays for all estimators
Passing 1D arrays to check_array, without setting `ensure_2d` to false now
raises a deprecation warning before reshaping it. This will later throw an
error.

All Scaler classes also throw warnings when 1D arrays are passed.

All unit tests/doctests are modified to ensure that no 1D arrays are passed,
except in explicit 1D array tests where the warnings have been silenced.

Additional tests are also included which check for different 1D array cases.

2D array tests with one samples and one features are also added and where
they failed, `check_array` call has been modified to give a more useful error
message
2015-09-09 15:49:58 +02:00
Jacob Schreiber 5978c0bbdf ENH split _tree.pyx into several files 2015-09-09 11:28:24 +02:00
Raghav R V 664d78eb7c MAINT Remove support for the deprecated sequence of sequences
MAINT Remove sequence of sequence support from datasets
MAINT Remove return_indicator param
MAINT Remove multilabel-seq test in OVR
MAINT Remove multilable-seq test in check_cv
MAINT Remove multilabel seq test in label_binarizer
TST type_of_target returns "unknown" for multilabel-sequence types
TST _check_targets should raise a ValueError
DOC show multilabel indicator as an example; remove return_indicator param
DOC use consistent lower case y for target
2015-08-11 22:26:44 +05:30
Andreas Mueller eedc1cddab Use more natural class_weight="auto" heuristic 2015-06-01 12:49:53 -04:00
Arnaud Joly 4e6346ef62 FIX raise error properly when n_features differ in fit and apply 2015-04-20 17:27:58 +02:00
Gilles Louppe 1aa4249bf3 ENH: raise NotFittedError instead of ValueError 2015-04-08 12:16:09 +02:00
Gilles Louppe 28a0994bf2 ENH: public apply method for decision trees 2015-04-08 12:10:27 +02:00
Daniel Galvez cfe4e15f54 Added tests of apply() for valid and invalid inputs. Fixed style. 2015-04-02 11:15:11 +02:00
Daniel Galvez 98dfdc6101 Make apply method of trees public. Added test for concistency with private method. 2015-04-02 11:13:10 +02:00
Raghav R V cd2ee7e454 MAINT docstring --> comments to prevent nose from using doc in verbose mode 2015-03-21 11:16:49 +05:30
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