Commit Graph

316 Commits

Author SHA1 Message Date
Thomas J. Fan 06d6f8a9f6
FIX Passes global configuration when spawning joblib jobs (#17634)
* WIP

* BUG Passes context to joblib jobs

* BUG Fix

* BUG Fix

* CLN Moves delayed into fixes

* CLN Adds linter

* REV Revert diff

* DOC Adds comment for removal

* Use a simple implementation
2020-09-21 16:59:42 +02:00
Olivier Grisel 68fb4db2cc
BENCH threading scalabikity of HGBRT (#18382) 2020-09-15 16:55:43 +02:00
Ram Rachum 61ec6b9b79
MNT Use raise from in 19 modules (#17835) 2020-08-25 08:57:29 +02:00
Daniel López daebcac781
FEA Add PolynomialCountSketch to Kernel Approximation module (#13003)
* Add Tensor Sketch algorithm

* Add user guide entry

* Add example

* Add benchmark

Co-authored-by: Christian Lorentzen <lorentzen.ch@googlemail.com>
Co-authored-by: Tom Dupré la Tour <tom.dupre-la-tour@m4x.org>
Co-authored-by: Roman Yurchak <rth.yurchak@gmail.com>
2020-08-18 08:44:20 +02:00
Thomas J. Fan 7cc0177f8e
MNT Replaces numpy alias with builtin typse (#17687)
* MNT Replaces numpy alias with builtin typse

* STY Lint error
2020-06-24 16:51:51 +02:00
Nicolas Hug 0a866ecaa9
MNT New options for higgs-boson benchmark (#16779) 2020-03-27 12:02:25 -04:00
Nicolas Hug 913da3f286
MNT Fix higgs boson benchmark (#16740) 2020-03-22 10:08:33 +01:00
Adrin Jalali e24998f19c
ENH Support sample weights in HGBT (#14696) 2020-02-24 13:45:50 -05:00
Thomas J Fan ae0dcddce8
BUG Fixes benchmark script for early stopping (#16476) 2020-02-19 00:05:23 +01:00
Brian Wignall 0e10b3a3cb DOC Fix typos, via a Levenshtein-style corrector (#15923) 2019-12-19 16:26:02 -08:00
Leland McInnes db59dd74df [MRG] Fast, low memory, single linkage implementation (#11514)
* First cut at basic single linkage internals

* Refer to correct dist_metrics package

* Add csgraph sparse implementation for single linkage

* Add fast labelling/conversion from MST to single linkage tree; remove uneeded single_linkage.pyx file.

* Ensure existing tests cover single linkage

* Name cingle linkage labelling correctly.

* Iterating toward correct solution. Still have to get n_clusters, compute_full_tree=False working

* Get n_components correct.

* Update docstrings.

* Fix the parents array when we don't get the "full tree"

* Add single linkage to agglomerative clustering example.

* Add single linkage to digits agglomerative clustering example.

* Update documentation to reflect the addition of single linkage.

* Update documentation to reflect the addition of single linkage.

* Pep8 fix for class declaration in cython

* Fix heading in clustering docs

* Update the digits clustering text to reflect the new reality.

* Provide a more complete comparison of the different linkage methods, highlighting the relative strengths and weaknesses.

* We don't need connectivity here, and we can ignore issues with warnings for spectral clustering.

* Add an explicit test that single linkage successfully works on examples it should perform well on.

* Update docs with a more complete comparison on linkage methods (scale to be determined?)

* List formatting in example linkage comparison.

* Flake8 fixes.

* Flake8 fixes.

* More Flake8 fixes.

* Fix agglomerative plot example with correct subplot spec

* Explicitly test linkages (including single) produce results identical to scipy.cluster.hierarchical

* Fix comment on why we sort (consistency)

* Make dense single linkage faster

* Add docstring to new mst-linkage-core computations.

* Add a test that new single linkage code matches scipy

* Ensure we only attemtp this for metrics Jake implemented.

* Per amueller; it's a long paper, ref the figure.

* Clean up a few things.

* Too many blank lines for flake8

* Bad scipy slink input

* Flake8 fixes

* Clean up cython a little; fix typo/carryover

* Convert memoryview to numpy array on return

* Just convert to the correct dtype

* Update sklearn/cluster/_hierarchical.pyx

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Update sklearn/cluster/_hierarchical.pyx

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Update sklearn/cluster/_hierarchical.pyx

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Update sklearn/cluster/tests/test_hierarchical.py

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Fixes as per @NicolasHug suggestions.

* Update renaming of params in test_hierarchical

* Relative import?

* Ah, it got renamed in master...

* A bad merge on my part.

* In principle this is in sklearn.neighbors now...

* No; not that way...

* Declare dim before use.

* Update sklearn/cluster/tests/test_hierarchical.py

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Remaining fixes per Nicolas Hug.

* Update sklearn/cluster/tests/test_hierarchical.py

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Fix flake8 issues.

* Switch from stable to mergesort per jnotham

* Update sklearn/cluster/_hierarchical.py

Co-Authored-By: Nicolas Hug <contact@nicolas-hug.com>

* Skip checks that are already validated.

* Update docstring per Gael's suggestion

* Add a benchmark script for agglomerative clustering

* Fix some flake8 issues

* No flake8 on the one line

* Update parameters and output for benchmark hierarchical

* Switch to 2D plotting for hierarchical benchmark

* Wrong colormap name

* Formatting fpr bench hierarchical

* Add an item to WhatsNew
2019-11-21 22:55:57 -05:00
Nicolas Hug 839a2a2fbf MNT import kmeans from sklearn.cluster (#15407) 2019-10-30 16:34:27 +01:00
Thomas Moreau 908ded83c8 ENH Parallelize gradient computation in t-SNE (#13264) 2019-10-30 10:17:10 -04:00
Nicolas Hug b92455a6b2 MAINT Deprecate all of utils.testing except all_estimators (#15367) 2019-10-28 17:28:56 +01:00
Thomas J Fan 5756a9934b MNT Make modules private in decomposition (#15344) 2019-10-28 22:46:16 +08:00
Thomas J Fan 4a95e33e63 MNT Make modules private in sklearn.datasets (#15307) 2019-10-27 17:17:23 -04:00
Thomas J Fan 0a7adef005 MNT Make modules private in linear_model (#15324) 2019-10-23 15:34:26 +02:00
Nicolas Hug 5cf88db244 EHN Implement least absolute deviation loss in GBDTs (#13896) 2019-09-09 10:26:52 +02:00
Nicolas Hug 4b6273b874 ENH Native support for missing values in GBDTs (#13911)
* Added NaN support in mapper

* pep

* WIP

* some more

* WIP

* WIP

* bug fix

* basic tests

* some doc

* avoid some interactions

* Added tag

* better test

* decent test + fix bug

* add missing_fraction param to benchmark

* bin training and validation data separately

* shorter test

* Map missing values to first bin instead of last

* pep8

* Added whats new entry

* avoid some python interactions

* make predict_binned work

* fixed bug due to offset in bin_thresholds_ attribute

* more sensible binning strat

* typo

* user name

* Add small test

* convert to fortran array in tests

* some doc

* Added function test

* pep8

* Bin validation data using binmaper of training data

* Allocate first bin for missing entries based on the whole data, not just
training data.

* Addressed Thomas' comments

* Update sklearn/ensemble/_hist_gradient_boosting/tests/test_grower.py

* Addressed Guillaume's comments

* always allocate first bin for missing values

* reduce diff

* minor more consistent test

* typo

* WIP

* some doc

* reduce diff

* pep8

* minor

* remove prints

* towards nan only splits

* don't check right to left on split_on_nan

* cleaups

* format and comment

* Fixed bug + added more tests

* refactor tests

* put back n_threads to max value

* minor changes

* minor cleaning

* Add (failing) test that checks equivalence with min max imputation

* Decrease the likelihood of ties when training the trees

* More robust test

* Fix pytest parametrization

* Check bin thresholds in test

* Try to make the test even easier to see if the Linux 32bit build would pass in this case

* Don't check last non-missing bin if there's no nan

* Improve min-max imputation test

* FIX: _find_best_bin_to_split_right_to_left is still required even when left to right wants to split on nans

* comments

* remove split_on_nan

* ooops deleted useless files

* Got rid of individual checks in predictor code

+inf thresholds are only allowed in a split on nan situation.
Thresholds that are computed as +inf are capped to a very high constant
value

* can also remove special case in binning code

* minor typos + more consistent test

* renamed types -> common

* 1e300 -> almost inf

* added user guide section on missing values

* Addressed Olivier's comment + updated whatsnew

* addressed comments

* Fix doctest formatting

* Fix nan predictive doctest
2019-08-21 11:22:00 +02:00
Andreas Mueller 92af3dabbb MAINT simplify check_is_fitted to use any fitted attributes (#14545) 2019-08-13 22:09:07 +02:00
qdeffense f13c9c0752 CLN remove redundant default parameters in examples and tests (#14590)
remove redundant 'fit_intercept=True' in examples and tests along with some instances of other redundant parameters (max_iter=100, C=1 and alpha=1.0)
2019-08-07 10:38:41 -07:00
Harsh Mahajan 228109cd5c MAINT Remove tolerance paramter from Perceptron (#14558) 2019-08-02 16:11:46 -04:00
Harsh Mahajan 38fd24ac1e EXA Remove redundant tol parameter for SGDClassifier (#14556) 2019-08-02 14:04:10 -04:00
Tilen Kusterle a8efe00876 EXA Use return_X_y=True with load_digits where appropriate (#14359) 2019-07-14 17:10:54 +02:00
Roman Yurchak 2fc3a85b3f MAINT Use isinstance(x, numbers.Integral) to check for integer dtype (#14004) 2019-06-12 19:24:59 -04:00
Roman Yurchak ccd3331f7e MNT remove unused imports (#14021) 2019-06-04 23:15:19 +10:00
Guillaume Lemaitre 778b11904e [MRG] DEP remove threshold_, change contamination, deprecate behaviour in iforest (#13811) 2019-05-22 12:41:47 +10:00
Guillaume Lemaitre af4247b152 DEP remove utilities related to mldata (#13798) 2019-05-21 18:37:09 +10:00
Guillaume Lemaitre 8a8e21b2a3 MNT Change the default value of n_estimators in forests (#13803) 2019-05-09 21:19:20 +08:00
Nicolas Hug 9f68c992ae [MRG+2] Faster Gradient Boosting Decision Trees with binned features (#12807) 2019-04-26 21:14:59 +02:00
Kuai Yu fec7670ad0 ENH Enable the "sufficient stats" mode of LARS (#11699) 2019-03-06 08:06:47 +01:00
Joan Massich f02ef9f52f LogisticRegression convert to float64 (for SAG solver) (#13243)
* Remove unused code

* Squash all the PR 9040 commits

initial PR commit

seq_dataset.pyx generated from template

seq_dataset.pyx generated from template #2

rename variables

fused types consistency test for seq_dataset

a

sklearn/utils/tests/test_seq_dataset.py

new if statement

add doc

sklearn/utils/seq_dataset.pyx.tp

minor changes

minor changes

typo fix

check numeric accuracy only up 5th decimal

Address oliver's request for changing test name

add test for make_dataset and rename a variable in test_seq_dataset

* FIX tests

* TST more numerically stable test_sgd.test_tol_parameter

* Added benchmarks to compare SAGA 32b and 64b

* Fixing gael's comments

* fix

* solve some issues

* PEP8

* Address lesteve comments

* fix merging

* avoid using assert_equal

* use all_close

* use explicit ArrayDataset64 and CSRDataset64

* fix: remove unused import

* Use parametrized to cover ArrayDaset-CSRDataset-32-64 matrix

* for consistency use 32 first then 64 + add 64 suffix to variables

* it would be cool if this worked !!!

* more verbose version

* revert SGD changes as much as possible.

* Add solvers back to bench_saga

* make 64 explicit in the naming

* remove checking native python type + add comparison between 32 64

* Add whatsnew with everyone with commits

* simplify a bit the testing

* simplify the parametrize

* update whatsnew

* fix pep8
2019-02-27 11:14:29 +01:00
Roman Yurchak 0e3bb17e62 MAINT Run pyupgrade following Python2 deprecation (#12997) 2019-02-08 20:13:34 +08:00
surgan12 62d2059804 MNT remove __future__ imports (#12791) 2019-02-02 22:05:06 +08:00
Hanmin Qin 60be46cd33 API Deprecate externals.six (#12916) 2019-01-27 19:16:42 +11:00
Thomas Fan a7b8b9e9e1 MAINT Removes total_seconds completely in benchmarks (#12969) 2019-01-13 16:41:28 +01:00
Rohan Lekhwani e0697b01a7 MNT Used scipy.special.expit for the inverse of the logit function (#12931) 2019-01-08 18:35:19 +11:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Roman Yurchak 8d7e849428 BENCH Make benchmarks/bench_text_vectorizers.py run faster (#12842) 2018-12-23 10:58:23 +08:00
Thomas Moreau d25da1be20 FIX make joblib utils private, and remove mentions of externals.joblib (#12345) 2018-11-20 10:53:52 +11:00
Andrew Nystrom a5fa7d3e6f [MRG] Fast PolynomialFeatures on CSR matrices (#12197) 2018-10-19 10:55:14 +02:00
TakingItCasual f4e7d2b19a Converting http to https (3)... (#12302) 2018-10-05 18:50:31 +02:00
TakingItCasual 74b56dbc57 MNT Converting http to https (#12277) 2018-10-04 22:37:57 +08:00
Nicolas Goix 53622e856c FIX: enfore backward compatibility of decision function in Iforest (#11553) 2018-07-23 13:05:48 +02:00
Joel Nothman 14e7c328df Restructure access to vendored/site Joblib (#11471)
In order to fix #11408, this swaps `joblib` and `_joblib`. It however, allows users to access joblib's `Memory` or `Parallel` functionality without accessing `sklearn.externals._joblib` by importing `Memory`, `Parallel`, etc. into `sklearn.utils`.
2018-07-17 18:02:11 +02:00
Andreas Mueller eec7649236 MAINT Complete 0.20 deprecations (#9570) 2018-06-24 23:06:26 +10:00
Loïc Estève 8c3e028608 FIX bench_plot_lasso_path.py error.
TypeError: numpy.float64 object cannot be interpreted as an integer.
2018-04-25 18:38:06 +02:00
Nicholas Nadeau, P.Eng., AVS 3e26fc63be MAINT Fixing Typos (#11017) 2018-04-24 09:32:25 +10:00
Albert Thomas 7f19dbeb75 [MRG+1] Fix LOF and Isolation benchmarks (#9798) 2017-10-25 15:22:21 +02:00
Thomas Moreau cb1b6c4734 FIX t-SNE memory usage and many other optimizer issues (#9032)
Use a sparse matrix representation of the neighbors.
Re-factored the QuadTree implementation to avoid insertion errors.
Various fixes in the gradient descent schedule to get the Barnes Hut and exact solvers to behave more robustly and consistently.
2017-07-12 22:56:02 +02:00