Commit Graph

632 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
Guillaume Lemaitre 4c33ea2ee0 [MRG+1] EHN/DOC Make error msg about Memory more explicit (#8865) 2017-05-17 22:51:16 +10:00
aivision2020 6e8ebdac4e [MRG+1] FIX bug where ransac is running too many iterations (#8271) 2017-04-30 07:57:23 +10:00
Arthur Mensch 5147fd09c6 Add SAGA solver for LogisticRegression and Ridge (#8446) 2017-03-27 21:39:30 +02:00
gedeck 668a24c9e6 [MRG + 1] Return correct ridge parameter alpha_ and lambda_ for Bayesian ridge regression (#8567)
* Return correct ridge parameter alpha_ and lambda_ for regression

* Add test for coefficients and fix style

* Move sklearn.utils.testing to a more reasonable position.

* Make flake8 happy

* Code cleanup and entry in whats_new.rst
2017-03-16 10:22:58 +01:00
Ping-Yao, Chang f952e4355c [MRG+1] add docs that C can receive array in RandomizedLogisticRegression (#6537)
* doc: state that parameter C can receive an array

* add more details in doc, and check the dim of C

* doc: state that parameter C can receive an array

* add more details in doc, and check the dim of C

* a little modification

* minor modifications and make line length less than 79 characters

* remove the backslash and correct typos

* meet PEP8's E128 requirement

* use .format and add a test
2017-02-18 07:38:11 +01:00
Stephen Hoover 3a0ea190c5 [MRG+1] Accept keyword parameters to hyperparameter search fit methods (#8278)
* ENH Accept keyword parameters to hyperparameter search fit methods

Deprecate ``fit_params`` as a constructor argument to the hyperparameter search classes and instead accept keyword parameters to the ``fit`` methods. This makes the ``fit`` methods of these functions conform to the Estimator API and allows the use of hyperparameter search functions in other CV utility functions such as ``cross_val_predict``.

* CR: Expanded tests, remove deprecated use in Ridge

* Make tests consistent in Python 2 and 3
2017-02-09 07:42:23 +01:00
CJ Carey 08772c42e7 FIX Ensure coef_ is an ndarray when fitting LassoLars (#8160)
* Fix gh-1615: ensure self.coef_ is an ndarray
2017-01-18 21:44:28 +11:00
mthorrell d0ce0d9b38 [MRG+2] Avoid failure in first iteration of RANSAC regression (#7914)
Fixes #7908 

Adds RANSACRegressor attributes n_skips_* for diagnostics
2017-01-05 14:30:00 +11:00
Thierry Guillemot fcb706a7c0 [MRG+3] Fused types for MultiTaskElasticNet (#8061)
* Convert ElasticNet Multioutput to floating.

* Remove all the float64 coordinate_descent.

* Add the necessary cblas for use fused types.

* Fix zeros dtype issue in cd_fast.

* Remove cblas files.

* Change random seed to let test_lle_simple_grid pass.

* Add tests to check floatting issue for MultiTaskElasticNet.

* Update cblas_sscal.c
2016-12-28 11:31:38 +01: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
He Chen 1995994f86 added random_state=0 to many instances (#7968) 2016-12-02 22:01:20 +01:00
Sergey Feldman 67a85b8ed8 [MRG+2] Adding return_std options for models in linear_model/bayes.py (#7838)
* initial commit for return_std

* initial commit for return_std

* adding tests, examples, ARD predict_std

* adding tests, examples, ARD predict_std

* a smidge more documentation

* a smidge more documentation

* Missed a few PEP8 issues

* Changing predict_std to return_std #1

* Changing predict_std to return_std #2

* Changing predict_std to return_std #3

* Changing predict_std to return_std final

* adding better plots via polynomial regression

* trying to fix flake error

* fix to ARD plotting issue

* fixing some flakes

* Two blank lines part 1

* Two blank lines part 2

* More newlines!

* Even more newlines

* adding info to the doc string for the two plot files

* Rephrasing "polynomial" for Bayesian Ridge Regression

* Updating "polynomia" for ARD

* Adding more formal references

* Another asked-for improvement to doc string.

* Fixing flake8 errors

* Cleaning up the tests a smidge.

* A few more flakes

* requested fixes from Andy

* Mini bug fix

* Final pep8 fix

* pep8 fix round 2

* Fix beta_ to alpha_ in the comments
2016-12-01 10:52:18 -05: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
Thierry Guillemot 915458bb71 Fix RandomState in the tests of linear model. (#7881) 2016-11-15 19:30:13 +01:00
jmontoyam 5230382ae6 [MRG + 1] Fix numerical instability in LassoLars when alpha=0 (#7778) (#7849)
* Fix bug 7778

* Add test_lasso_lars_vs_R_implementation

* Add a space to match the indentation

* Solve E501 line too long (80 > 79 characters)

* assert_array_almost_equal up to 12 decimals

* Tiny modification for increasing performance

* Update what's new page

* Trying to solve conflicts

* Solve conflict in doc/whats_new.rst
2016-11-11 19:01:29 -08:00
Raghav RV 31ee1a8e6e [MRG + 2] FIX LogisticRegressionCV to correctly handle string labels (#5874)
* TST if LogisticRegressionCV handles string labels properly
* TST Add a test with class_weight dict
* ENH Encode y and class_weight dict
* Better variable names
* TYPO casses --> classes
* FIX Use dict comprehension; classes_labels --> classes
* Revert dict comprehension (for Python 2.6 compat)
* MNT reorder validation to improve clarity
* Add whatsnew entry
2016-11-09 21:40:51 +01:00
Karan Desai db3c0959f6 [MRG+1] Warning raised by MultiTaskElasticNet.fit is now ConvergenceWarning. (#7806)
* Warning raised by MultiTaskElasticNet.fit is now ConvergenceWarning.
2016-11-03 15:42:33 +01:00
nuffe 0dfc9a5167 [MRG + 1] ElasticNetCV: raise ValueError if l1_ratio=0 (#7591)
Raise ValueError if l1_ratio=0 in ElasticNetCV and alphas=None
2016-10-25 10:07:02 +02:00
Ishank Gulati cee48cdf8f removed cv_ prefix (#6252) 2016-10-08 10:27:41 +09:00
Artem Golubin 36e67a91af Fix test suites (#6348) 2016-10-07 19:47:43 -04:00
Konstantin Podshumok 9b2aac9e5c [MRG + 1] [TST] (half-cosmetic) use less nose.tools import to simplify future transition to py.test (#7384)
* use less nose.tools import to simplify future transition to activly developing test suites/runners

* assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values

and one missed ImportError that should be replaced with AttributeError

* test for py2.6 compat with except AttributeError

* fix importing of SkipTest

* force using nose in python2.6 for now

* there was no assert_dict_equal in py2.6. but we can use assert_equal

although failed test will look a little bit ugly

* remove nose imports from doc/datasets
2016-10-07 12:46:52 -04:00
bthirion b32897f1c3 [MRG+2]: Fix Ridge GCV with centered data (#6178) 2016-10-05 15:39:56 +02:00
Andrea Esuli 69c8382253 [MRG+1] Added 'average' option to passive aggressive classifier/regressor. (#4939) 2016-09-30 12:49:26 +10:00
Gael Varoquaux 4b2304f05a Merge pull request #7261 from betatim/negative-scorers
[MRG + 2] Rename scorers like `mse` to `neg_mse`
2016-09-08 20:40:17 +02:00
Yen 845e702ab9 [MRG+2] Make `enet_coordinate_descent_gram` support fused types (#7218)
* Make cd_gram support fused types

* Add test
2016-08-29 15:59:06 +02:00
Tim Head ef64969f91 Introduce deprecation warning and fix tests
get_scrorer now warns if you use an old name for a scorer
and tests have been updated to use new naming convention.
2016-08-27 14:56:40 +02:00
Yen 084ef97f16 [MRG+2] ElasticNet and Lasso now support float32 dtype input (#6913)
ElasticNet and Lasso no longer implicitly convert float32 dtype input to float64 internally.

* Make helper functions in cd use fused types

* Import cblas float functions

* Make enet_coordinate_descent support fused types

* Make dense case work

* Refactor format

* Remove redundant change

* Add cblas files

* Avoid redundant code

* Remove redundant c files and import

* Recover unnecessary change

* Update comment

* Make coef_ type consistent

* Test float32 input

* Add user warning when fitting float32 data with small alpha

* Fix bug

* Change variable to floating type

* Make cd sparse support fused types

* Make CD support fused types when data is sparse

* Add referenced src files

* Avoid duplicated code

* Avoid type casting

* Fix indentation in test

* Avoid type casting in sparse implementation

* Fix indentation

* Fix duplicated intialization code

* Follow PEP8

* Raise tmp precision to double

* Add 64 bit computer check

* Fix test

* Add constraint

* PEP 8

* Make saxpy have the same structure as daxpy

Hopefully this fixes the problems outlined in PR #6913

* Remove wrong hardware test

* Remove dsdot

* Remove redundant asarray

* Add test for fit_intercept

* Make _preprocess_data support other dtypes

* Add concrete value

* Workaround

* Fix error msg

* Move declarartion

* Remove redundant comment

* Add tests

* Test normalize

* Delete warning

* Fix comment

* Add error msg

* Add error msg

* Add what's new

* Fix error msg
2016-08-25 09:36:39 -07:00
Alexandre Gramfort fa8fe859c4 update what's new + simplify test 2016-08-20 15:19:13 +02:00
Behzad Tabibian 2d39122898 droping extra y 2016-08-20 15:15:38 +02:00
Behzad Tabibian fe20981c39 removing extra fit call and cleanup code 2016-08-20 15:15:38 +02:00
Behzad Tabibian 02cd2fbc37 removing make_sparse_data call 2016-08-20 15:15:38 +02:00
Behzad Tabibian 076d9553d1 test case for ElasticNet multiple output matching with dense 2016-08-20 15:15:38 +02:00
Olivier Grisel 668b329d42 FIX make HuberRegressor tests stable under 32 bit Linux (#7196) 2016-08-17 15:50:34 +02:00
Loïc Estève 8ad12edde7 Use pgtol parameter in fmin_l_bfgs call (#7167)
in HuberRegressor. Since fmin_l_bfgs does not take a 'tol' parameter it
resulted in the scipy < 0.9 branch always being called.
2016-08-09 21:48:40 -07:00
David Staub 12d5f07831 [MR] Speed issues in sample_without_replacement - bugfix (#7104)
* Remove cdivision=True Cython compiler directive causing incorrect int division.

* Decrease tol for LogisticRegression fit test, perhaps needed due to test not controlling `random_state`.
2016-08-06 21:23:19 +10:00
Raghav RV 2a9492b38f [MRG] MAINT Removing more deprecated stuff for v0.18 (#5528)
* MNT Removing more deprecated stuff for v0.18

* MNT+TST Remove support for loss='l2'

* MNT Remove support for precompute='auto' for ElasticNet

* FIX/TST precompute=auto should raise a generic message
2016-08-03 22:16:04 +10:00
Gael Varoquaux 1837224751 Merge pull request #6613 from nelson-liu/correct_license_spelling
[MRG+1] DOC: fix spellings of 'license'
2016-06-15 13:58:59 +02:00
Tom Dupré la Tour 1107f223d5 use class_weight through sample_weight in LogisticRegression with liblinear 2016-05-25 14:54:02 +02:00
Wenhua Yang 7ce4f5c517 FIX incorrect gradient computation for SquaredEpsilonInsensitive loss 2016-05-10 09:32:15 +02:00
Nelson Liu d2aaf0f4bb doc: fix spellings of 'license' 2016-03-31 17:25:31 -07:00
MechCoder 7e79adca9d Huber regressor
Add gradient calculation in _huber_loss_and_gradient

Add tests to check the correctness of the loss and gradient

Fix for old scipy

Add parameter sigma for robust linear regression

Add gradient formula to robust _huber_loss_and_gradient

Add fit_intercept option and fix tests

Add docs to HuberRegressor and the helper functions

Add example demonstrating ridge_regression vs huber_regression

Add sample_weight implementation

Add scaling invariant huber test

Remove exp and add bounds to fmin_l_bfgs_b

Add sparse data support

Add more tests and refactoring of code

Add narrative docs

review huber regressor

Minor additions to docs and tests

Minor fixes that deals with dealing with NaN values in targets
and old verions of SciPy and NumPy

Add HuberRegressor to robust estimator

Refactored computation of gradient and make docs render properly

Temp

Remove float64 dtype conversion

trivial optimizations and add a note about R

Remove sample_weights special_casing

address @amueller comments
2016-02-25 16:31:08 -05:00
YenChenLin 46fc1be145 Remove redundant words in sklearn 2016-02-23 16:54:03 +08:00
giorgiop 140a5acda8 MAINT depr of center_data, normalize in linear_model 2016-02-17 14:26:50 -05:00
Olivier Grisel 9cbceb32c1 MAINT split test_ridge.test_dense_sparse with generator 2016-02-07 00:45:24 +01:00
giorgiop 9ee3f50c15 MAINT speed up test_coordinate_descent 2016-02-06 18:55:23 +01:00
MechCoder 761b1f7118 Deprecate residual_metric and add support for loss 2016-01-14 17:42:34 -05:00
imaculate 41526cb19c Added sample_weight parameter to ransac.fit 2016-01-14 12:49:40 -05:00
seales 0485ada58b General spelling fixes 2015-12-16 09:46:42 -08:00
TomDLT 9f136ff293 ENH add multinomial SAG solver for LogisticRegression 2015-12-04 18:36:37 +01:00