Commit Graph

88 Commits

Author SHA1 Message Date
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
Peter Wang 4ab99c75b4 [MRG+1] FIX Correct depth formula in iforest (#8576)
* Fixed depth formula in iforest

* Added non-regression test for issue #8549

* reverted some whitespace changes

* Made changes to what's new and whitespace changes

* Update whats_new.rst

* Update whats_new.rst

* fixed faulty whitespace

* faulty whitespace fix and change to whats new

* added constants to iforest average_path_length and the according non regression test

* COSMIT

* Update whats_new.rst

* Corrected IsolationForest average path formula and added integer array equiv test

* changed line to under 80 char

* Update whats_new.rst

* Update whats_new.rst

* reran tests

* redefine np.euler_gamma

* added import statement for euler_gammma in iforest and test_iforest

* changed np.euler_gamma to euler_gamma

* fix small formatting issue

* fix small formatting issue

* modified average_path_length tests

* formatting fix + removed redundant tests

* fix import error

* retry remote server error

* retry remote server error

* retry remote server error

* re-added some iforest tests

* re-added some iforest tests
2017-03-14 16:50:23 +01:00
willduan 1f278e1c23 Fix version comparison for the numpy 1.12 beta (#7902) 2016-12-05 10:22:26 +01:00
Loïc Estève e5bf61eee1 [MRG+1] Dropping python 2.6 support (#7890)
* Remove Python 2.6 support

Some details about some slightly orthogonal changes:
* Note about cheking safely for nan is likely not valid any more (commit
  introducing it is c80ca91b)
* scipy.linalg.qr econ parameter removed since scipy 0.9 in favour of
  mode='economic'
* Remove unnecessary libgfortran in conda create command

* Putative fix by setting the random seed

* Revert unintended change

* Reinstate previous logic for checking for NaNs

* Reinstate change in error message

Error messages from Python 2.7 assertRegexp does not contain the
function name, in contrast with Python 3 assertRegex
2016-11-23 17:11:04 -05:00
Antoine Wendlinger 74a9756fa7 [MRG+2] Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin) #2121 (#6181)
* Norm inconsistency between RFE and SelectFromModel (was _LearntSelectorMixin) #2121

* safe_pwr utility

* Norm fix

* Removed safe_pwr

* 1D arrays support for norm fix

* Test case for 2d coef in SelectFromModel

* Fix numpy version requirement for norm fix

* Implement fixes suggested by @jnothman

* Add numpy version requiring the fix.
2016-10-24 14:01:49 -04:00
Raghav RV 868a58b2e0 [MRG+1] FIX Make sure GridSearchCV and RandomizedSearchCV are pickle-able (#7594)
* FIX Subclass a new MaskedArray which allows pickling even when dype=object

* TST unpickling too

* FIX Use MaskedArray from utils.fixes rather than from numpy

* FIX imports

* Don't assign a variable

* FIX np --> numpy

* Use tostring instead of tobytes for old numpy

* COSMIT pickle-able --> picklable

* use #noqa comment to turn off flake8

* TST/ENH Check if the pickled est's predict matches with the original one's
2016-10-10 15:33:44 -04:00
Andreas Mueller 280c70bf4f add numpy versions for backports / fixes 2016-10-04 11:20:12 -04:00
jblackburne ba7cf38f99 Removed isclose from _binary_clf_curve. (#7353)
Added a bugfix report to whats_new.rst. Modified a unit test to check for the kind of problems caused by isclose.
2016-09-11 12:48:32 +10:00
Raghav R V afd5d18b0c [MRG] ENH Restructure grid_scores_ into a dict of 1D arrays
Also, DOC what's new section for model_selection changes
2016-06-16 12:23:04 +10:00
Vighnesh Birodkar f46033067d docstring elaboration and typo in fixes.py 2016-04-05 19:57:19 -04:00
Andreas Mueller 7efeb5ab60 ENH added elkan k_means algorithm
renamed elkan -> triangle_inequality, lloyd-> full

pep8, rename _kmeans_single -> _kmeans_single_lloyd

add a docstring to elkans k-means in cython.

fixed text for full

Fixed elkans kmeans so that predict is same as labels

Added test to ensure full and triangle_inequality give same results

changed triangle_inequality to elkan

Addressed review comments

removed rebase artifacts

correct whats_new

moved enhancement bullet to 0.18

removed extra newline

strong typing dor prototype

fixed random state

removed c file

removed merge artifacts

removed entry from 0.17

Add documentation and inline_comments to _k_means_elkan.pyx

Minor rearrngement of docstring sentences

removed call to np.sort to improve speed for large number of clusters

replced logic with call to np.partition

Fallback to sort if partition does not exist

use partition from fixes rather than numpy
2016-04-05 19:57:19 -04:00
Tim Head 07cede74ca Multitarget regression meta estimator
Register OneVsRestRegressor as meta estimator

Rename to a more sensible name

Parallel predict and sparse support

Started MultiOutput documentation

Move code to new file multioutput.py

Continuing the move to new multioutput module

Added sample weight support

Better test for sample weights and actually support weights

Added a new test using weighted vs repeated samples to
test sample weight support. Uncovered that weights
were not actually passed on to underlying estimator.

Comment on multiprocess overheads

Move parallel_helper to utils.fixes

This helper works around a python2 limitation on pickling
instance methods

Example of multi-output regression with gradient boosting

Switch to uniform weighted score and updated example

The example now uses a RF with and without the MultiOutput
meta estimator

Added note for removing `score` method

Addressing comments on MultiOutputRegressor

MultiOutputregressor better test for weighted samples

Fix ups

Use explicit keyword argument for passing sample weights and
fix random_state on train-test split in the example
2016-03-10 16:06:08 -05:00
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +02:00
Olivier Grisel 6966881328 MAINT use inspect.signature for introspection 2015-09-23 16:30:53 +02:00
TomDLT fecd35567e FIX array_equal for numpy < 1.8.1 2015-09-16 19:15:48 +02:00
TomDLT 792e529519 add fetch_rcv1 2015-07-16 12:29:00 +02:00
Olivier Grisel f9eb9cfbee STYLE whitespace around operator in sklearn.utils.fixes 2015-04-13 11:20:36 -04:00
Olivier Grisel 7ac6c9b3ac FIX respect astype(array, dtype, copy=True) on old numpy 2015-04-09 08:02:03 -04:00
Loïc Estève bd9d16b5ee Simplify the code by using len 2015-02-01 18:48:05 +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
Joel Nothman 0c9377ece9 ENH use parallelism for all metrics in pairwise_{kernels,distances} 2015-01-17 21:48:17 +11:00
Olivier Grisel 54f483aafa FIX #2986: ZeroDivisionError in LinearRegression on sparse data 2014-11-14 12:51:43 +01:00
Lars Buitinck a7a05120e2 MAINT: handle frombuffer with empty 1st arg in utils.fixes 2014-09-22 17:23:51 +02:00
Joel Nothman 69af355dc2 FIX only use testing.ignore_warnings in tests 2014-08-06 09:59:42 +10:00
Hamzeh Alsalhi cbcae0459c FIX Support unseen labels LabelBinarizer and test
This fix restores the default behavior of 0.14.1 for backward
compat.
2014-07-29 16:21:04 +02:00
Gael Varoquaux 4aac610dc3 TST: Fix warnings in np 1.9
These break our tests
2014-07-25 13:40:47 +02:00
Lars Buitinck 7d564b3c76 FIX expit bug with out != None 2014-07-14 22:30:02 +02:00
Jeffrey Blackburne 58c0a757f1 PEP8 fix 2014-06-13 22:11:53 -07:00
Jeffrey Blackburne 6ea9fbeddb Added a backport of numpy.isclose from numpy v1.8.1. This function was not available until numpy v1.7 2014-06-13 22:02:59 -07:00
Lars Buitinck f4251347af ENH/DOC fix poly features complexity
Fixes #3191, #3194.
2014-06-05 17:45:32 +02:00
CJ Carey 46aebf132b ENH: use partial sort for kneighbors selection 2014-05-30 21:11:50 +02:00
Thomas Unterthiner 325e998fcc Extend utils.sparsefuncs: inplace scale and axis min/max 2014-05-18 20:03:37 +10:00
Olivier Grisel 58577203e7 FIX: remove casting warning under Python 3 2014-03-29 00:43:35 +01:00
Joel Nothman c530f5aed4 FIX for early numpy where astype(..., copy=...) unavailable 2014-03-12 14:24:26 +11:00
Lars Buitinck d9d02aa4d7 COSMIT get rid of warning from expit import 2014-03-10 17:49:33 +01:00
Lars Buitinck 33a45388bc FIX + TST stability problems with scipy.special.expit
Fixes issue reported by @argriffing at #2882: expit is buggy in
SciPy < 0.14 (to be released). Switch implementation back to
old one based on stability test; toughened unit tests.
2014-03-03 22:01:06 +01:00
Lars Buitinck 23b3cc2eb5 MAINT drop support for SciPy < 0.9
TODO: get rid of solve_triangular. Just replacing it by scipy.linalg's
breaks OMP and least-angle regression.
2014-03-02 20:13:57 +01:00
Lars Buitinck b97fb3c5fc MAINT drop support for NumPy < 1.6.1 2014-03-02 20:13:57 +01:00
Lars Buitinck 0ba1e28cd5 ENH speed up RBM training with scipy.special.expit
SciPy 0.10 already has an implementation of the logistic function called
scipy.special.expit.

Using this makes RBM training 12% faster, as measured by observing the time
per iteration as reported by the plot_rbm_logistic_classification.py example,
disregarding the first iteration as an outlier (it's consistently faster than
the rest, not sure why). The speedup is in the expit function, not the
inplace operations; those are there to make benchmarking easier, but they
certainly won't hurt.
2014-02-23 17:46:53 +01:00
Joel Nothman dbc26ce996 COSMIT remove unused imports and variables 2014-02-03 19:43:56 +11:00
Gilles Louppe 6454b5f0f7 DOC: add docstring to _logaddexp 2013-09-11 22:00:31 +02:00
Gilles Louppe f8bf44a251 FIX: logaddexp(-inf, -inf) == -inf and not NaN 2013-09-11 21:31:46 +02:00
dengemann 599ba2d976 FIX: ghost diff 2013-08-25 12:00:06 +02:00
dengemann f6a1c5aeff update what's new 2013-08-25 11:16:21 +02:00
dengemann 2240e44f31 ENH: add fast_dot function 2013-08-25 11:16:20 +02:00
Lars Buitinck 31ad968af6 MAINT remove Counter from fixes; no longer used 2013-08-12 12:52:17 +02:00
Alexandre Gramfort a6f91b3955 revert the tanh fix 2013-07-30 19:46:35 +02:00
Alexandre Gramfort b236030015 FIX : backport tanh out param in old numpy 2013-07-30 17:11:18 +02:00
Andreas Mueller e488704849 COSMIT pep8 2013-07-23 15:17:32 +02:00
Justin Vincent d420aafb0f TST + PY3 various fixes
* Little hack in fixes.py that can be removed when NumPy's
  https://github.com/numpy/numpy/issues/3484 is fixed.
* Little cleanup to the fixes implementation.
* Change the numpy workaround and added a test. Fixed some xrange usage.
* Fix the weight boosting test.
* None is not comparable in python3
* Fix a test that depended on dictionary iteration order.
* Python3 removed execfile
* More test fixes.

Fixes #2122.
2013-07-05 20:17:23 +02:00