Commit Graph

97 Commits

Author SHA1 Message Date
ningchi 6ce198c78f [MRG] #6581 n_samples of utils.resample can be more when replace is True
* #6581 n_samples can be more when replace is True

* more compact code
2016-04-02 08:58:40 +02: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
Raghav R V a228016585 Leading underscores for warnings imported from sklearn.exceptions
in other modules where warnings are deprecated.

Prefix warnings imported from sklearn.exceptions instead of
suffixing to prevent showing both the suffixed warning
and the deprecated warning during tab completion.
2016-01-08 12:40:10 -05:00
Raghav R V 857cb09254 FIX/ENH Make the moved class resilient to the deprecation patching 2015-10-20 01:24:35 +02:00
Raghav R V 61ae8d56c4 MAINT move deprecated into deprecation.py 2015-10-19 22:35:36 +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
Vighnesh Birodkar 2f099334f9 MAINT deprecate 1d input arrays for all estimators
Passing 1D arrays to check_array, without setting `ensure_2d` to false now
raises a deprecation warning before reshaping it. This will later throw an
error.

All Scaler classes also throw warnings when 1D arrays are passed.

All unit tests/doctests are modified to ensure that no 1D arrays are passed,
except in explicit 1D array tests where the warnings have been silenced.

Additional tests are also included which check for different 1D array cases.

2D array tests with one samples and one features are also added and where
they failed, `check_array` call has been modified to give a more useful error
message
2015-09-09 15:49:58 +02:00
Andreas Mueller 990a6b402f FIX n_jobs slicing bug in dict learning, add input validation to gen_even_slices 2015-05-20 15:29:25 -04:00
TomDLT 89c1018c64 ENH improve check_array
ENH improve check_array to warn on dtype conversions

ENH make check_array accept several dtypes

ENH change validation with improved check_array

ENH change astype to avoid copy if possible

ENH remove warn_if_not_float
2015-05-19 16:13:42 +02:00
Andreas Mueller cdfaabfa0b FIX work-around for read only dataframes 2015-05-05 19:26:35 -04:00
Olivier Grisel e12863f103 FIX make shuffle / resample pass-through indexing utilities 2015-04-10 16:11:22 -04:00
Andreas Mueller e1af92b640 remove cross_validation.Bootstrap 2015-03-18 14:51:37 -04:00
Raghav R V a59eee8fc9 FIX Add check_symmetric to __all__ 2015-02-24 18:16:20 -05:00
trevorstephens c5fadff91c add compute_sample_weight util 2015-01-31 18:26:41 -08:00
Raghav R V b3fbccca38 FIX various mismatch between docstring and signature params
DOC max_iterations -> max_iter. Make it consistent with kmeans

MAINT Replace the deprecated dx parameter with d in the docstrings

MAINT Deprecation warning for max_iterations parameter.
2015-01-16 11:54:57 -05:00
Jake VanderPlas a21957e85c rename ensure_symmetric -> test_symmetric 2014-12-29 08:36:25 -08:00
Jake VanderPlas 7794d90471 MAINT: create ensure_symmetric utility function to check matrix symmetry 2014-12-28 21:02:35 -08:00
Olivier Grisel f0fe4afd1e Merge pull request #2949 from FlorianWilhelm/theilsen
[MRG+1] TheilSen robust linear regression
2014-11-20 15:34:01 +01:00
Olivier Grisel fe553b755a ENH use specific warning class for RP 2014-11-18 14:55:56 +01:00
Florian Wilhelm a5d2fd915a Merge branch 'master' into theilsen
Conflicts:
	doc/modules/model_evaluation.rst
2014-10-09 17:43:21 +02:00
Will Lamond 766fb56ec0 FIX allow ndim>2 in shuffle
Fixes #3694.
2014-09-25 19:29:44 +02:00
Florian Wilhelm a8000405de COSMIT: Small changes regarding Theil-Sen
- Typo fixed in linear_model documenation
- Usage of matplotlib.pyplot instead of matplotlib.pylab
- Removed trailing backslash in import statements
- Renamed _modweiszfeld_step to _modified_weiszfeld_step
- Renamed variable fst to first_elem in _lstq
- Made get_n_jobs private in utils/__init__.py
2014-09-24 19:58:21 +02:00
Florian Wilhelm 49d30431da FIX: doctest of get_n_jobs 2014-09-06 12:06:48 +02:00
Florian Wilhelm 9db5ba15eb ENH: Refactoring in theil_sen
- Moved _get_n_jobs to utils.get_n_jobs
- Reworked unittest of _get_n_jobs as doctest
- Made unittest of theil_sen a bit nicer
2014-09-06 11:50:57 +02:00
Lars Buitinck 37ac31440f MAINT remove unused MST code 2014-09-04 12:47:35 +02:00
Joel Nothman 1c01da064b ENH faster safe_indexing for common case 2014-08-07 19:45:21 +10:00
Andreas Mueller c235c3b566 ENH add allowed_sparse named argument for @ogrisel 2014-07-20 15:31:28 +02:00
Andreas Mueller 6e2a83b4e1 remove check_arrays stuff and old input validation 2014-07-20 13:31:45 +02:00
Andreas Mueller f7549fd2ba Refactor input validation. 2014-07-20 10:40:04 +02:00
Andreas Mueller b080d93b5e ENH don't convert dataframes in grid search and cross-validation 2014-07-18 10:02:14 +02:00
Andreas Mueller 3c7818e8cf ENH allow y to be a list in GridSearchCV, cross_val_score and train_test_split. 2014-07-16 10:59:57 +02:00
Joel Nothman dbc26ce996 COSMIT remove unused imports and variables 2014-02-03 19:43:56 +11:00
dengemann 39fb5c5922 address discussion 2013-11-29 13:55:39 +01:00
dengemann 9b1207b01d ENH: final fix: clear all regisitries 2013-11-29 13:55:39 +01:00
Joel Nothman 9e1edd11e3 FIX stop forcing deprecation warnings for external packages 2013-11-28 14:32:07 +11:00
Lars Buitinck 13a83155eb FIX sparse matrix indexing in BernoulliRBM
Fixes #2545, reported by @jfelectron.
2013-10-27 17:51:33 +01:00
Johannes Schönberger d2c5f98dd4 Add ransac function to __init__.py of utils package 2013-10-20 15:57:53 +02:00
Philippe Gervais 1cd73c645d Added gen_batches() to utils
This generator is similar to gen_even_slices(), but takes a slice length
as input instead of a number of slices.
2013-08-27 10:29:40 +02:00
Andreas Mueller d8f90d137d use column_or_1d, move it to utils 2013-07-26 17:16:27 +02:00
Andreas Mueller 1c133e8eb5 ENH add "make_y_1d" to utils, use it in estimators where needed. 2013-07-26 17:16:26 +02:00
Robert Layton 4e1e1ab772 Now that the folder has more than just mst in it, rename to sparsetools, which should help with referencing it. 2013-07-22 10:27:26 +02:00
Lars Buitinck 43c55b5f0d FIX get rid of the last few asanyarray calls
This function passes through the evil np.matrix unchanged.
2013-07-11 15:54:13 +02:00
Jaques Grobler 8861833ec9 DOC spellfixes 2013-06-29 16:18:23 +03:00
Robert Layton 67cdef8078 Moved mst to a subfolder and added a README file 2013-06-04 13:57:15 +02:00
Robert Layton 8ad6b7b376 Added test 2013-06-04 13:57:15 +02:00
Lars Buitinck 09f2d90262 P3K make feature_extraction.text work
All tests pass with Py2 and Py3.
2013-03-10 22:20:29 +01:00
Mikhail Korobov bd5e502278 P3K fix incorrect import
(it breaks e.g. "import sklearn.metrics" under Python 3.3)
2013-01-11 05:02:51 +06:00
Andreas Mueller 1c1538af87 ENH move utility function into dedicated file, not __init__.py 2013-01-03 13:28:10 +01:00
Andreas Mueller 956975a70e DOC changed docstring to be more clear. 2013-01-03 13:21:51 +01:00
Andreas Mueller 3be8a23d2d ENH addressed @ogrisel's comments. 2013-01-03 13:21:51 +01:00