Commit Graph

339 Commits

Author SHA1 Message Date
Andreas Mueller 1c41368bac [MRG+1] Uncontroversial fixes from estimator tags branch (#8086)
* some bug fixes.

* minor fixes to whatsnew

* typo in whatsnew

* add test for n_components = 1 transform in dict learning

* feature extraction doc fix

* fix broken test

* revert aggressive input validation changes

* in SelectFromModel, don't store threshold_ in transform. If we called "fit", use estimates from last "fit".

* move score from EllipticEnvelope to OutlierDetectionMixin

* revert changes to Tfidf documentation

* remove dummy input validation from whatsnew

* fix text feature tests

* rewrite from_model threshold again...

* remove stray condition

* fix self.estimator -> estimator, slightly more interesting test

* typo in comment

* Fix issues in SparseEncoder, add tests.
more explicit explanation of SparseEncoder change, add issue numbers to whatsnew

* minor fixes in whats_new.rst

* slightly more consistency with tuples for shapes

* not longer typo
2017-06-06 16:34:47 +02:00
Naoya Kanai bd0fc236e0 [MRG+1] MAINT drop SciPy < 0.13 (#8854)
Remove sklearn.utils.fixes functions that are not needed for scipy >= 0.13 and keep deprecated wrappers in other modules.
2017-06-02 23:36:33 +02: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
Guillaume Lemaitre 676f878e98 FIX set min_impurity_split to None in gradient boosting estimator (#8789) 2017-04-25 14:47:09 +02:00
Guillaume Lemaitre e3c9ae204f [MRG+1] DOC improve description and consistency of random_state (#8689)
* DOC improve description of random_state in train_test_split

* DOC Make random_state consistent through documentation

* FIX reverse doc mistake

* FIX address comment of Tom

* DOC address comments

* DOC remove empty line

* DOC remove unecessary white spaces
2017-04-05 17:43:21 -07: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
He Chen 919b4a8fbd [MRG + 1] Fix gradient boosting overflow and various other float comparison on == (#7970)
* reintroduced isclose() and flake8 fixes to fixes.py

* changed == 0.0 to isclose(...)

* example changes

* changed back to abs() < epsilon

* flake8 convention on file

* reverted flake8 fixes

* reverted flake8 fixes (2)

* np.finfo(np.float32).tiny instead of hard coded epsilon 1e-150

* reverted to 1e-150

* whats new modified
2017-03-07 09:21:38 -05: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
Tahar 6f771d5186 [MRG] Remove unnecessary backticks around parameter name in docstrings (#8432) 2017-02-22 16:17:04 +01:00
Ekaterina Krivich be305cebaf TST/FIX Add check for estimator: parameters not modified by `fit` (#7846)
ensure that estimators only add private attributes and attributes with
  trailing _

  in cases when existing estimators don't follow this new rule, we deprecate the
  attributes and make them follow this rule
2017-01-20 11:33:17 +11:00
Alexis Mignon b6854944fb [MRG+1] Corrected sign error in QuantileLossFunction (#6429)
* Corrected sign error in QuantileLossFunction
2016-12-22 18:09:58 +01:00
Sebastian Pölsterl 3162f980a9 [MRG] Set min_impurity_split in gradient boosting models (#8007)
Fixes #8006
2016-12-14 10:40:49 +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
Joel Nothman 8570622a44 [MRG+1] DOC insert spaces before colons in parameter lists (#7920)
* DOC insert spaces before colons in parameter lists

Complies with numpydoc to improve rendering and automatic quality
assurance such as #7793. Affects listings of Parameters Attributes,
Returns.

Performed with the help of:

    grep -nE '^(    )+[a-zA-Z][a-zA-Z0-9_]*: ' sklearn -R | grep -v -e
    externals -e tests | grep -v -e default: -e else: -e Warning: -e Note:
    -e TRAIN: -e Default: -e True: -e False: -e DOI: -e In: | gsed
    's|\([^:]*\):\([0-9]*\):\([^:]*\):\(.*\)|--- a/\1\n+++ b/\1\n@@ -\2,1
    +\2,1 @@\n-\3:\4\n+\3 :\4|' | git apply --unidiff-zero -

* DOC fix numpydoc format for param
2016-11-25 10:59:22 +01:00
Ibraim Ganiev 78dbcb2838 [MRG] fix #6101 GradientBoosting decision_function for sparse inputs (#6116) 2016-10-15 21:41:44 +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
Preston Parry 7f4d279dc3 Minor docstring clarification (#6926) 2016-08-28 19:23:05 +02: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
YenChenLin 46fc1be145 Remove redundant words in sklearn 2016-02-23 16:54:03 +08:00
Andrew McCulloh 19f109ce87 The presort parameter is never acutally used 2015-11-16 15:07:09 -08:00
Andrew McCulloh 6ec1c38ab3 Change super call to pass presort value to super 2015-11-16 14:47:03 -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 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
Jiali Mei 85223b9bcc a common test to check if classifiers fail when fed regression targets 2015-10-14 14:46:13 -04:00
Jacob Schreiber 02c0029baa ENH gbt sparse support 2015-09-28 13:44:12 -07:00
Andreas Mueller 6dd6f8ffe8 minor fixes to the doc build 2015-09-11 17:32:51 -04:00
Jacob Schreiber bc225a5e1a ENH apply method added to Gradient Boosting 2015-09-10 10:32:51 +02:00
Jacob Schreiber 5978c0bbdf ENH split _tree.pyx into several files 2015-09-09 11:28:24 +02:00
Jungkook Park 8453daa6b9 Use expit function to compute the probability in ExponentialLoss class. 2015-06-08 13:03:52 -04:00
Andreas Mueller 0650d5502e DOC adding backlinks to docstrings 2015-06-03 00:24:04 -04:00
Andreas Mueller 0aea95c715 DOC add random_state to parameter docstring in gradient boosting 2015-05-11 12:11:41 -04:00
Andreas Mueller 72450ea8a3 DOC GradientBoostingX.estimators_ docstring shape. 2015-04-06 13:19:39 -04:00
Andreas Mueller d89c215013 Add tags to classifiers and regressors to identify them as such. 2015-03-31 19:59:49 -04:00
Peter Prettenhofer 6f335af7ee fix issue 4447 : min_weight_leaf not properly passed to PresortBestSplitter 2015-03-25 14:11:13 +01:00
Olivier Grisel 3468e00471 Merge pull request #4057 from amueller/dtype_object_conversion
[MRG + 2] make check_array convert object to float.
2015-02-24 22:33:20 +01:00
Andreas Mueller 0036dd0319 ENH make defensive copies in GradientBoosting*.staged_decision function. 2015-02-24 16:28:33 -05:00
Andreas Mueller 96d4b3e709 more robust check for dtype object 2015-02-18 14:11:58 -08:00
Andreas Mueller cd5166e82f make check_array convert object to float.
fix dtype check, add test. unfriend all multi-output estimators on facebook.

try to fix what is happening to y (by doing nothing to y)

make test work...

Make everything accept object y or say "invalid label"

fix multioutput linear models

add test for sensible error message.
2015-02-15 12:13:41 -05:00
Lars 38104ff4e8 Merge pull request #4193 from lesteve/deactivate-travis-default-venv
CI: test with NumPy 1.6.1, fix for its broken bincount
2015-02-03 16:25:36 +01:00
Lars cfd68ef435 Merge pull request #4198 from arjoly/gbrt-fix-percent-max_features
FIX Ensure at least 1 feature is sampled when max_features is a float
2015-02-03 15:59:56 +01:00
Arnaud Joly 92ed5eee42 FIX ensure that negative float max_features will lead to an error 2015-02-03 13:39:18 +01:00
Arnaud Joly 92b90815a6 FIX Ensure at least 1 feature is sampled when max_features is a float 2015-02-03 13:30:17 +01:00
Loïc Estève 67dcd99d82 TST fix tests with numpy 1.6.1
np.bincount raises an Exception with empty input arrays for numpy versions < 1.6.2
Add utils.fixes.bincount to tackle this issue and use it instead of np.bincount
2015-02-01 15:49:49 +01:00