Commit Graph

53 Commits

Author SHA1 Message Date
Loïc Estève deaa96452a Fix test_validation.py 2017-09-01 14:19:19 +02:00
Pravar D Mahajan ecc96be8c5 [MRG] Raise exception on providing complex data to estimators (#9551)
* Modifies model_selection.cross_validate docstring (#9534)

- Fixes rendering of docstring examples
- Instead of importing cross_val_score in example, cross_validate is imported

* raise error on complex data input to estimators

* Raise exception on providing complex data to estimators

* adding checks to check_estimator for complex data

* removing some unnecessary parts

* autopep8 changes

* removing ipdb, restoring some autopep8 fixes

* removing ipdb, restoring some autopep8 fixes

* adding documentation for complex data handling

* adding one line explanation for each test case
2017-09-01 11:26:19 +02:00
Kumar Ashutosh e66aa6dc70 ENH Ducktyping to allow for alternative Memory implementations (#9584) 2017-08-30 15:21:24 +10:00
Joan Massich 06d0e0da01 [MRG + 2] improve check_array error message (#9126) 2017-06-26 11:10:39 +02:00
Joel Nothman ee88cf44ea [MRG+1] Option to suppress validation for finiteness (#7548)
* ENH add suppress validation option

* TST skip problematic doctest

* Rename SUPPRESS_VALIDATION to PRESUME_FINITE

* Change PRESUME_ to ASSUME_ for convention's sake

* DOC add note regarding assert_all_finite

* ENH add set_config context manager for ASSUME_FINITE

* Make ASSUME_FINITE private and provide get_config

* Fix ImportError due to incomplete change in last commit

* TST/DOC tests and more cautious documentation for set_config

* DOC what's new entry for validation suppression

* context manager is now config_context; set_config affects global config

* Rename missed set_config to config_context

* Fix mis-named test

* Mention set_config in narrative docs

* More explicit about limmited restoration of context

* Handle case where error raised in config_context

* Reset all settings after exiting context manager
2017-06-08 13:42:17 +02:00
guiniol 45d9182e6d [MRG+1] Fix float size in as_float_array (#8598)
* Fix float size in as_float_array

* Add tests for small ints in as_float_array

* Add test for object dtype

with minor tweaks
2017-03-21 16:13:48 +01:00
Kat Hempstalk daeba62b9c [MRG+2] Fixed assumption fit attribute means object is estimator. (#8418) 2017-02-21 14:20:05 +01:00
Olivier Grisel 096a9cbead [MRG] MAINT Python 3.6 fixes (#8123)
* FIX dict order dependent doctest

* FIX str concat TypeError message changed in Python 3.6

* MAINT upgrade travis config with most recent conda deps
2016-12-27 19:50:25 +01:00
Josh Karnofsky e5ceda88f2 FIX check_array's accept_sparse param now takes true/false/str/list, but not None (#7937) 2016-12-20 21:45: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
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
Loïc Estève 50ab94db46 MockDataFrame.__array__ should take an optional dtype 2016-08-26 10:18:35 +02:00
Raghav R V 857cb09254 FIX/ENH Make the moved class resilient to the deprecation patching 2015-10-20 01:24: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
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
Immanuel Bayer 0949a2e353 remove order checks for sparse matrices 2015-04-16 14:13:26 +02:00
Andreas Mueller 89c1dc5488 FIX be robust to columns name dtype and also to dataframes that hold dtype=object. 2015-04-07 15:54:42 -04:00
Raghav R V cd2ee7e454 MAINT docstring --> comments to prevent nose from using doc in verbose mode 2015-03-21 11:16:49 +05:30
Andreas Mueller f1b8283c95 catch some warnings, be less verbose in testing. 2015-03-02 14:40:35 -05:00
Joel Nothman 69827c4b58 TST Test check_consistent_length and TypeError with ensemble arg 2015-02-26 16:30:39 +01:00
Olivier Grisel feceab6f62 FIX test for consistent handling on empty input data 2015-02-26 10:45:06 +01:00
Lars Buitinck d90a8ae451 TST test last commit 2015-02-16 13:06:12 +01:00
Olivier Grisel d16e9eeb1b FIX stricter validation for non-empty input data 2015-02-14 00:39:26 +01:00
Raghav R V 0bca2ffdfa FIX Refactor _is_fitted method into check_is_fitted.
DOC Make the docstring of NotFittedError class to conform to pep8.

DOC Make the error message of check_is_fitted more newbie friendly.
2015-01-12 00:33:40 +05:30
Raghav R V b3209c10fc MAINT Add new function to check if an estimator is fitted
TST Add tests for the _is_fitted and check_is_fitted fns
2015-01-12 00:32:20 +05:30
Jake VanderPlas 53f3b72660 make utils.check_symmetric future-proof 2014-12-31 09:00:18 -08:00
Jake VanderPlas 358e16390c TST: add test of check_symmetric 2014-12-29 08:36:42 -08:00
akshayah3 4d94392b49 Added _check_sample_weight 2014-09-28 19:23:36 +05:30
akshayah3 16bc265ed8 dded tests to test_boosting 2014-09-28 14:58:55 +05:30
akshayah3 11d3696de2 Added make_fit_parameter method 2014-09-27 19:35:13 +05:30
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
mjbommar 724b63a16c Replacing the test .todense() methods with .toarray() 2014-05-20 21:44:34 -04:00
Michael Eickenberg c7519ee87a TST safe_asarray for dok_matrix and lil_matrix 2014-04-06 13:41:54 +02:00
Lars Buitinck c0657ce683 ENH less copying in validation for neighbors 2014-04-06 13:38:45 +02:00
hamzeh eb04ccbc5e Implemented a check for ndim exceeding two in the utils.check_arrays function 2014-03-11 09:55:52 -04:00
Philippe Gervais e0011e4bd6 [BUG] safe_asarray() converts sparse matrices dtype
When called with a dtype kw argument, utils.safe_asarray() would
not change the dtype of a sparse matrix. This has been fixed.

Unit tests have been created for safe_asarray().
2013-08-27 10:28:27 +02:00
Andreas Mueller 5a1fde1194 COSMIT fixing some unused imports, adding stuff to __all__, and light pep8 (not all whitespace to make rebasing less painful) 2013-07-27 15:44:17 +02:00
Nicolas Trésegnie c91504a7fe Add test of the as_float_array behaviour when copy=True 2013-07-23 14:46:14 +02:00
Lars Buitinck 3840fecd7a ENH order *does* matter for sparse matrices 2013-07-11 11:50:23 +02:00
Andreas Mueller 03048ddb5f ENH more logical behavior, better docstring, tests 2013-01-05 19:59:46 +01:00
Gael Varoquaux 7842748cf7 BUG: copy and keep ordering
This is due to a change in behavior in numpy that now does
not keep the ordering by default when copying.

Fixes #1186
2012-09-28 09:32:03 +02:00
Olivier Grisel 0eca37dc17 cosmit 2012-09-12 22:34:00 +02:00
Alexandre Gramfort e4838831d9 ENH : add copy param to array2d_or_csx 2012-09-02 23:16:52 +02:00
Alexandre Gramfort 2184c4698d ENH : add copy arg to array2d and new atleast2d_or_csr usual for sparse coordinate descent
Conflicts:

	sklearn/utils/validation.py
2012-09-02 23:16:51 +02:00
Alexandre Gramfort b59e1005fc FIX : make as_float_array keep fortran order on dense array when copy 2012-08-21 17:08:47 +02:00
Lars Buitinck 38c3c30207 COSMIT refactor input validation code and tests 2012-07-20 15:18:16 +02:00
Alexandre Gramfort ad8e4912cb TST: use assert_true instead of assert + remove some relative imports 2012-02-11 15:43:03 +01:00