Commit Graph

420 Commits

Author SHA1 Message Date
Rüdiger Busche d300f406ae MAINT Simplify super() calls (#12812) 2019-01-10 22:27:06 +01:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Nicolas Hug 4ab60559c8 MNT Change deprecation for min_impurity_split from removal to changing the default (#12400) 2018-11-20 09:54:08 +11:00
Adrin Jalali a80bbd9403 ENH add get_n_leaves() and get_max_depth() to DesicionTrees (#12300) 2018-10-10 22:01:11 +11:00
TakingItCasual 1e052e9da9 Converting http to https (2)... (#12292) 2018-10-04 23:06:14 +02:00
Joel Nothman 79f5d147ea MNT Revert the deprecation of min_samples_leaf and min_weight_fraction_leaf (#11998) 2018-09-08 16:43:21 +02:00
Joel Nothman 2fe58e517c Deprecate min_samples_leaf and min_weight_fraction_leaf (#11870) 2018-08-23 08:30:47 +03:00
lkjcalc 5045c9bc6b DOC Fix ExtraTree docstrings (#11454) 2018-07-08 09:06:51 +08:00
Hanmin Qin 1480e9ffd8 DOC Improve doc of Tree object in DecisionTreeClassifier/Regressor (#11228) 2018-06-11 09:00:55 +10:00
Hanmin Qin 4a90d6824b DOC Broken link in ExtraTreeClassifier/Regressor 2018-06-10 21:58:46 +08:00
Luis Pedro Coelho cc600b4417 DOC use "fraction" and not "percentage" (#10653)
Percentage would imply that the value would be divided by 100.
2018-02-18 10:46:05 +11:00
Joel Nothman c3bdc0a89a
DOC clean up assorted type specifications (#10441) 2018-01-11 09:11:17 +11:00
fenx 4bba21659c [MRG+1] Error raised when presort in gradient_boosting.py and tree.py is not a boolean (#10110) 2017-11-28 13:27:13 +01:00
Minghui Liu ffe9866e5f Use base.is_classifier instead instead of isinstance (#9482) 2017-08-08 14:36:03 +02:00
Warut Vijitbenjaronk 8485d3eb5c [MRG] Add Explanation of MSE vs Friedman MSE vs MAE criterion in Regression Tree Building (#9367)
* clarified documentation for regression tree criterion

* added explanation on doc/modules/tree.rst
2017-07-17 10:02:18 -07:00
(Venkat) Raghav, Rajagopalan b6f8865b0a [MRG + 1 (rv) + 1 (alex) + 1] Add a check to test the docstring params and their order (#9206)
* add automatic test of docstrings for function / method signatures using numpydoc
2017-07-11 18:42:10 +02:00
Sebastin Santy dc43486806 Remove unused imports (#9235) 2017-07-01 05:57:54 -07:00
Vivek Kumar a150d93078 Updated error message for max_leaf_nodes (#8975)
Solves #8964
2017-06-02 09:29:59 -07:00
Guillaume Lemaitre 92cb166647 [MRG] DOC Homogeneous deprecation in docstring (#8907)
Update developers doc to use "deprecated" sphinx directive.
2017-05-23 08:42:08 +02:00
Lera 8717a159ab [MRG] Extended explanation of using class_weight in RandomForestClassifier (Issue #6646) (#8838)
* Extended explanation of using class_weight in RandomForestClassifier

* Extended explanation of using class_weight in DecisionTreeClassifier,ExtraTreesClassifier and compute_sample_weight()

* Rephrased description.

* Rephrased description (remove "indicator")
2017-05-09 18:21:12 +10:00
Hanmin Qin 834608ec1d MAINT Remove unused condition (#8778) 2017-04-23 22:14:42 +10:00
Peter Csizsek 7d1e430cd9 [MRG] Notes about default params for trees (#8721)
* Added note to trees and random forests to warn users about the default parameters for controlling tree sizes.

* Rephrased tree size warning.

* Rephrased tree warnings again.

* Added note to ExtraTree* algorithms.
2017-04-10 01:16:19 +10:00
(Venkat) Raghav (Rajagopalan) fc2f24927f [MRG+1] ENH/FIX Introduce min_impurity_decrease param for early stopping based on impurity; Deprecate min_impurity_split (#8449)
[MRG+2] ENH/FIX Introduce min_impurity_decrease param for early stopping based on impurity; Deprecate min_impurity_split
2017-04-03 09:38:53 -07:00
Guillaume Lemaitre cc3ce58953 [MRG+1] FIX/DOC Improve documentation regarding non-determinitic tree behaviour (#8452)
* FIX/DOC Improve documentation regarding non-determinitic tree behaviour

* FIX correct max_features
2017-02-26 18:48:19 +01:00
mikebenfield 84cc67b039 Clarify error message for min_samples_split. (#8167) 2017-01-09 08:41:16 +11:00
Joel Nothman 84f260aea0 Use 1.0 not 1 in error message regarding float value 2016-12-15 12:59:07 +11:00
Loïc Estève e542efafe2 TST Ensure that attributes ending _ are not set in __init__ (#7464) 2016-12-12 21:57:43 +11:00
Andreas Mueller 5c4b1bb231 [MRG+1] Housekeeping Deprecations for v0.19 (#7927)
* remove stuff to be removed 0.19

* more changes

* remove classes from 0.19 whatsnew

* remove _LearntSelectorMixin

* remove ProjectedGradientNMF, load_lwf_*

* minor fixes

* remove more copy from logistic regression path

* remove lda, qda from __init__.__all__

* remove pg solver in nmf from tests etc

* remove class_weight="auto" from tests

* doctest change for decision_function_shape="ovr"

* remove transfrom from tree test, minor fixes to tree tests

* some fixes in the tests

* undo changes in functions which still allow 1d input...

* also allow 1d in scale

* more test fixes...

* last test fixes in forest and tree

* svm default value change doctest failures

* pep8

* remove more class_weight="auto" stuff

* minor cosmetics in docstrings deprecated / removed behavior.

* say that store_covariance has been moved to __init__ in discriminant_analysis
2016-12-09 12:43:38 -05:00
Aman Dalmia f32d257b6a [MRG+2] DOC adding separate `fit()` methods (and docstrings) for DecisionTreeClassifier and DecisionTreeRegressor (#7824)
* DOC adding separate fit() functions

* DOC adding keywords to arguments of super()

* DOC removing trailing whitespaces

* DOC specifying the type of class labels

* DOC removing docstring from BaseDecisionTree.fit
2016-11-09 13:32:22 -05:00
Nelson Liu 33ed90dc0a [MRG] FIX min_samples_split and min_samples_leaf validation for float vs int (#7604) 2016-10-10 00:39:17 +11:00
Nelson Liu da118d0cb4 [MRG+3] Fix min_weight_fraction_leaf to work when sample_weights are not provided (#7301)
* fix min_weight_fraction_leaf when sample_weights is None

* fix flake8 error

* remove added newline and unnecessary assignment

* remove max bc it's implemented in cython and add interaction test

* edit weight calculation formula and add test to check equality

* remove test that sees if two parameter build the same tree

* reword min_weight_fraction_leaf docstring

* clarify uniform weight in forest docstrings

* update docstrings for all classes

* add what's new entry

* move whatsnew entry to bug fixes and explain previous behavior
2016-09-28 14:48:23 +10:00
Andreas Mueller 60a1356f31 [MRG + 1] More versionadded everywhere! (#7403)
* insert versionadded versionchanged directives in docstrings for 0.18

indicate where exception classes were moved from

* moved versionadded in the proper places
2016-09-27 16:19:47 -04:00
CeShine Lee 0e1fd12d1e DOC Correction: max_depth is effective when max_leaf_nodes is not None (#7183) 2016-08-17 07:57:05 +10:00
Nelson Liu 7de6e7022b [MRG + 1] add "versionadded" tags to min_impurity_split docstrings (#7093)
* add versionadded tags to min_impurity_split docstrings

* adjust positioning of versionadded tags

* remove spurious comment used to force recythonization
2016-07-28 14:31:55 -04:00
Nelson Liu 5085a7f316 add versionadded for MAE (#7105) 2016-07-28 13:50:52 -04:00
Nelson Liu 376aa50e70 [MRG+1] feature: add beta-threshold early stopping for decision tree growth (#6954)
* feature: add beta-threshold early stopping for decision tree growth

* check if value of beta is greater than or equal to 0

* test if default value of beta is 0 and edit input validation error message

* feature: separately validate beta for reg. and clf., and add tests for it

* feature: add beta to forest-based ensemble methods

* feature: add separate condition to determine that beta is float

* feature: add beta to gradient boosting estimators

* rename parameter to min_impurity_split, edit input validation and associated tests

* chore: fix spacing in forest and force recompilation of grad boosting extension

* remove trivial comment in grad boost and add whats new

* edit wording in test comment / rebuild

* rename constant with the same name as our parameter

* edit line length for what's new

* remove constant and set min_impurity_split to 1e-7 by default

* fix docstrings for new default

* fix defaults in gradientboosting and forest classes
2016-07-27 17:46:49 +02:00
Nelson Liu c84ff5e351 [MRG+3] Add mean absolute error splitting criterion to DecisionTreeRegressor (#6667)
* feature: add initial node_value method

* testing code for node_impurity and node_value

This code runs into 'Bus Error: 10' at node_value final assignment.

* fix: node_value now correctly calculating weighted median for sorted data.

Still need to change the code to work with unsorted data.

* fix: node_value now correctly calculates median regardless of initial order

* fix: correct bug in calculating median when taking midpoint is necessary

* feature: add initial version of children_impurity

* feature: refactor median calculation into one function

* fix: fix use of DOUBLE_t vs double

* feature: move helper functions to _utils.pyx, fix mismatched pointer type

* fix: fix some bugs in children_impurity method

* push a debug version to try to solve segfault

* push latest changes, segfault probably happening bc of something in _utils.pyx

* fix: fix segfault in median calculation and remove excessive logging

* chore: revert some misc spacing changes I accidentally made

* chore: one last spacing fix in _splitter.pyx

* feature: don't calculate weighted median if no weights are passed in

* remove extraneous logging statement

* fix: fix children impurity calculation

* fix: fix bug with children impurity not being initally set to 0

* fix: hacky fix for a float accuracy error

* fix: incorrect type cast in median array generation for node_impurity

* slightly tweak node_impurity function

* fix: be more explicit with casts

* feature: revert cosmetic changes and free temporary arrays

* fix: only free weight array in median calcuation if it was created

* style: remove extraneous newline / trigger CI build

* style: remove extraneous 0 from range

* feature: save sorts within a node to speed it up

* fix: move parts of dealloc to regression criterion

* chore: add comment to splitter to try to force recythonizing

* chore: add comment to _tree.pyx to try to force recythonizing

* chore: add empty comment to gradient boosting to force recythonizing

* fix: fix bug in weighted median

* try moving sorted values to a class variable

* feature: refactor criterion to sort once initially, then draw all samples from this sorted data

* style: remove extraneous parens from if condition

* implement median-heap method for calculating impurity

* style: remove extra line

* style: fix inadvertent cosmetic changes; i'll address some of these in a separate PR

* feature: change minmaxheap to internally use sorted arrays

* refactored MAE and push to share work

* fix errors wrt median insertion case

* spurious comment to force recythonization

* general code cleanup

* fix typo in _tree.pyx

* removed some extraneous comments

* [ci skip] remove earlier microchanges

* [ci skip] remove change to priorityheap

* [ci skip] fix indentation

* [ci skip] fix class-specific issues with heaps

* [ci skip] restore a newline

* [ci skip] remove microchange to refactor later

* reword a comment

* remove heapify methods from queue class

* doc: update docstrings for dt, rf, and et regressors

* doc: revert incorrect spacing to shorten diff

* convert get_median to return value directly

* [ci skip] remove accidental whitespace

* remove extraneous unpacking of values

* style: misc changes to identifiers

* add docstrings and more informative variable identifiers

* [ci skip] add trivial comments to recythonize

* remove trivial comments for recythonizing

* force recythonization for real this time

* remove trivial comments for recythonization

* rfc: harmonize arg. names and remove unnecessary checks

* convert allocations to safe_realloc

* fix bug in weighted case and add tests for MAE

* change all medians to DOUBLE_t

* add loginc allocate mediancalculators once, and reset otherwise

* misc style fixes

* modify cinit of regressioncriterion to take n_samples

* add MAE formula and force rebuild bc. travis was down

* add criterion parameter to gradient boosting and add forest tests

* add entries to what's new
2016-07-25 08:44:59 +02:00
Nelson Liu d2aaf0f4bb doc: fix spellings of 'license' 2016-03-31 17:25:31 -07:00
Rémy Léone 9b7176dd9d [DOC] Fix broken links 2016-03-23 12:45:34 -07:00
Andreas Mueller fb123ed24b More doc fixes. Latex builds again. 2015-11-20 16:30:45 -05:00
Preston Parry 77665e3c31 removes extra spaces from error message
I unfortunately got to know this error message too well when my data-formatting pipeline encountered a bug :)
2015-11-04 21:44:35 -08:00
KamalakerDadi f2e35411fa Added more versions of 0.17 2015-11-04 00:02:52 +01: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
Raghav R V 3f8743f47b Main Commits - Major
--------------------

* ENH Reogranize classes/fn from grid_search into search.py
* ENH Reogranize classes/fn from cross_validation into split.py
* ENH Reogranize cls/fn from cross_validation/learning_curve into validate.py

* MAINT Merge _check_cv into check_cv inside the model_selection module
* MAINT Update all the imports to point to the model_selection module
* FIX use iter_cv to iterate throught the new style/old style cv objs
* TST Add tests for the new model_selection members
* ENH Wrap the old-style cv obj/iterables instead of using iter_cv

* ENH Use scipy's binomial coefficient function comb for calucation of nCk
* ENH Few enhancements to the split module
* ENH Improve check_cv input validation and docstring
* MAINT _get_test_folds(X, y, labels) --> _get_test_folds(labels)
* TST if 1d arrays for X introduce any errors
* ENH use 1d X arrays for all tests;
* ENH X_10 --> X (global var)

Minor
-----

* ENH _PartitionIterator --> _BaseCrossValidator;
* ENH CVIterator --> CVIterableWrapper
* TST Import the old SKF locally
* FIX/TST Clean up the split module's tests.
* DOC Improve documentation of the cv parameter
* COSMIT consistently hyphenate cross-validation/cross-validator
* TST Calculate n_samples from X
* COSMIT Use separate lines for each import.
* COSMIT cross_validation_generator --> cross_validator

Commits merged manually
-----------------------

* FIX Document the random_state attribute in RandomSearchCV
* MAINT Use check_cv instead of _check_cv
* ENH refactor OVO decision function, use it in SVC for sklearn-like
  decision_function shape
* FIX avoid memory cost when sampling from large parameter grids

ENH Major to Minor incremental enhancements to the model_selection

Squashed commit messages - (For reference)

Major
-----

* ENH p --> n_labels
* FIX *ShuffleSplit: all float/invalid type errors at init and int error at split
* FIX make PredefinedSplit accept test_folds in constructor; Cleanup docstrings
* ENH+TST KFold: make rng to be generated at every split call for reproducibility
* FIX/MAINT KFold: make shuffle a public attr
* FIX Make CVIterableWrapper private.
* FIX reuse len_cv instead of recalculating it
* FIX Prevent adding *SearchCV estimators from the old grid_search module
* re-FIX In all_estimators: the sorting to use only the 1st item (name)
    To avoid collision between the old and the new GridSearch classes.
* FIX test_validate.py: Use 2D X (1D X is being detected as a single sample)
* MAINT validate.py --> validation.py
* MAINT make the submodules private
* MAINT Support old cv/gs/lc until 0.19
* FIX/MAINT n_splits --> get_n_splits
* FIX/TST test_logistic.py/test_ovr_multinomial_iris:
    pass predefined folds as an iterable
* MAINT expose BaseCrossValidator
* Update the model_selection module with changes from master
  - From #5161
  -  - MAINT remove redundant p variable
  -  - Add check for sparse prediction in cross_val_predict
  - From #5201 - DOC improve random_state param doc
  - From #5190 - LabelKFold and test
  - From #4583 - LabelShuffleSplit and tests
  - From #5300 - shuffle the `labels` not the `indxs` in LabelKFold + tests
  - From #5378 - Make the GridSearchCV docs more accurate.
  - From #5458 - Remove shuffle from LabelKFold
  - From #5466(#4270) - Gaussian Process by Jan Metzen
  - From #4826 - Move custom error / warnings into sklearn.exception

Minor
-----

* ENH Make the KFold shuffling test stronger
* FIX/DOC Use the higher level model_selection module as ref
* DOC in check_cv "y : array-like, optional"
* DOC a supervised learning problem --> supervised learning problems
* DOC cross-validators --> cross-validation strategies
* DOC Correct Olivier Grisel's name ;)
* MINOR/FIX cv_indices --> kfold
* FIX/DOC Align the 'See also' section of the new KFold, LeaveOneOut
* TST/FIX imports on separate lines
* FIX use __class__ instead of classmethod
* TST/FIX import directly from model_selection
* COSMIT Relocate the random_state documentation
* COSMIT remove pass
* MAINT Remove deprecation warnings from old tests
* FIX correct import at test_split
* FIX/MAINT Move P_sparse, X, y defns to top; rm unused W_sparse, X_sparse
* FIX random state to avoid doctest failure
* TST n_splits and split wrapping of _CVIterableWrapper
* FIX/MAINT Use multilabel indicator matrix directly
* TST/DOC clarify why we conflate classes 0 and 1
* DOC add comment that this was taken from BaseEstimator
* FIX use of labels is not needed in stratified k fold
* Fix cross_validation reference
* Fix the labels param doc

FIX/DOC/MAINT Addressing the review comments by Arnaud and Andy

COSMIT Sort the members alphabetically
COSMIT len_cv --> n_splits
COSMIT Merge 2 if; FIX Use kwargs
DOC Add my name to the authors :D
DOC make labels parameter consistent
FIX Remove hack for boolean indices; + COSMIT idx --> indices; DOC Add Returns
COSMIT preds --> predictions
DOC Add Returns and neatly arrange X, y, labels
FIX idx(s)/ind(s)--> indice(s)
COSMIT Merge if and else to elif
COSMIT n --> n_samples
COSMIT Use bincount only once
COSMIT cls --> class_i / class_i (ith class indices) -->
perm_indices_class_i

FIX/ENH/TST Addressing the final reviews

COSMIT c --> count
FIX/TST make check_cv raise ValueError for string cv value
TST nested cv (gs inside cross_val_score) works for diff cvs
FIX/ENH Raise ValueError when labels is None for label based cvs;
TST if labels is being passed correctly to the cv and that the
ValueError is being propagated to the cross_val_score/predict and grid
search
FIX pass labels to cross_val_score
FIX use make_classification
DOC Add Returns; COSMIT Remove scaffolding
TST add a test to check the _build_repr helper
REVERT the old GS/RS should also be tested by the common tests.
ENH Add a tuple of all/label based CVS
FIX raise VE even at get_n_splits if labels is None
FIX Fabian's comments
PEP8
2015-10-23 17:28:08 +02:00
Arnaud Joly 409c888aed Raise appropriate error if y is sparse 2015-10-23 17:28:07 +02:00
Alexandre Gramfort 5a58e56826 Merge pull request #5487 from arjoly/example-node
[MRG+1] Add an example and a method to analyse the decision tree stucture
2015-10-22 13:31:49 +02:00
Arnaud Joly bc02bd5243 ENH rename decision_paths to decision_path 2015-10-21 17:05:56 +02:00
Arnaud Joly 317281bf22 take glouppe comment 2015-10-21 17:05:55 +02:00
Arnaud Joly f6d605ff96 Implement decision path in tree 2015-10-21 17:05:55 +02:00
hlin117 d62e316882 #5322: Resolving Random Forest build errors (bad input shape) 2015-10-20 10:36:47 -05:00