Commit Graph

100 Commits

Author SHA1 Message Date
Raghav R V a87011262a FIX precision to float64 across the codebase 2015-10-16 11:20:29 +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 434ee958aa test for accepted sparse matrices 2015-08-26 22:00:55 -04:00
Andreas Mueller 0650d5502e DOC adding backlinks to docstrings 2015-06-03 00:24:04 -04:00
Vinayak Mehta 8702801c13 used special.fdtrc instead of fprob
added integer division
2015-03-23 21:46:59 +05:30
Martin Ku 2bc7ffef1c Add "See also" for selectors and scoring funs
Details:
- Reference uni variate selectors and scoring funcs
- Indicate chi2 is only for non-negative features
- Add "See also" formatting rules to contributing
- Add example of good "References" in docstrings
- Misc small doc updates for uni feature selection
  - Add missing periods (for consistency)
  - Anova -> ANOVA (for consistency)
  - Make a numbered list render per item per line (for readability)
  - Capitalize the first letter of a numbered list (for readability)
2015-03-10 21:40:25 +08:00
Olivier Grisel 95f1d9562b FIX DOC TST: alpha is an uppper bound on FDR 2015-02-24 16:26:24 -05:00
Andreas Mueller 700babc43f extensive (excessive?) testing of FDR 2015-02-24 16:26:24 -05:00
Andrew Tulloch 1add39ff11 [Feature Selection] Fix SelectFDR thresholding bug (#2771)
From https://github.com/scikit-learn/scikit-learn/issues/2771, we were
not correctly scaling the alpha
parameter (http://en.wikipedia.org/wiki/False_discovery_rate#Benjamini.E2.80.93Hochberg_procedure)
with the number of features (== hypothesis).  Thus, the alpha
parameter was not invariant wrt the number of features.

The correction is as suggested in the original issue, and a test has
been added that verifies that for various numbers of features, an
appropriate false discovery rate is generated when using the selector.
2015-02-24 16:25:58 -05:00
Olivier Grisel bc5b403af3 FIX #4059: explicit warning for strict selectors 2015-02-06 12:06:34 +01:00
Raghav R V abd31d2cad MAINT Make uniform the error raised for not fitted condition 2015-01-12 00:33:40 +05:30
Alexandre Gramfort bee0a98a1e cosmit in warning message 2014-10-08 21:04:59 +02:00
MechCoder 22cc25fc61 ENH: More descriptive error which prints the feature indices 2014-10-08 20:09:32 +02:00
MechCoder 0bd095f9d6 FIX: Raise warnings in f_classif a given feature is constant throughout 2014-10-08 19:32:47 +02:00
Joel Nothman b3bdb08964 DOC fix formatting of attributes etc. in docstrings 2014-07-28 19:04:59 +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
Arnaud Joly 185beb3e78 DOC remove comment thanks to @jnothman
'All our feature selectors output masks now (as they should, IMO).
It will be turned back into indices only for sparse matrix indexing,
but only until we require scipy >= 0.14 (?).'
2014-05-08 20:56:36 +02:00
Arnaud Joly e58405d6f6 MAINT remove redundant class hierarchy + fix api perform parameter check in fit 2014-05-08 20:56:21 +02:00
jnothman a3f81d9a04 Merge pull request #3010 from griffinmyers/fix-select-k-best
Fixed SelectKBest corner case: k=0
2014-03-28 09:32:31 +11:00
Will Myers f1e2e1c874 Fixed SelectKBest corner case: k=0
Without this fix k = 0 will have the same behavior as k = 'all' based on how
the array indexing was written.

I've included a test that demonstrates proper behaviour.
2014-03-27 15:18:50 -04:00
Lars Buitinck c1003ec51d DOC heapsort is not stable at all 2014-03-27 11:19:29 +01:00
VirgileFritsch 4d18fd8837 BF in f_regression: variable naming + use assert_*array*_almost_equal. 2014-02-07 19:28:06 +01:00
VirgileFritsch 8e0b4be57e BF: Correct degrees of freedom in f_regression + test. 2014-02-07 19:28:05 +01:00
Alexandre Gramfort f31d6d7538 pyflakes 2013-12-16 22:03:30 +01:00
Alexandre Gramfort 44270ddc83 fix f_oneway with ints 2013-12-16 22:02:05 +01:00
Lars Buitinck 551625fad7 MAINT simplify f_oneway in feature selection
reduce(lambda x, y: x + y, s) == sum(s), always.
2013-10-14 00:15:31 +02:00
Lars Buitinck 9e10ec017b COSMIT use norm function in feature selection 2013-10-13 23:20:39 +02:00
Lars Buitinck e8bad3d24a DOC ASCII only in docstrings
As discussed on the mailing list.
2013-08-28 18:22:57 +02:00
Lars Buitinck b46ea718af FIX remove warnings from univariate FS
These warnings are issued practically always when using
frequency-valued or boolean data.

Switched to a stable sort to get reproducible results.
2013-08-19 14:56:37 +02:00
Lars Buitinck bc2acb519c FIX yet another chi2 bug 2013-06-01 17:42:04 +02:00
Lars Buitinck b486875497 FIX bug (swapped args) in chi2
Added a non-regression test.
2013-06-01 17:26:20 +02:00
Lars Buitinck 194fa350d8 ENH speed up sklearn.feature_selection.chi2
New version is ~4× faster and reuses allocated arrays.
2013-05-30 12:23:29 +02:00
Joel Nothman 9a8845e913 ENH Create FeatureSelectionMixin for shared [inverse_]transform code
Also rename FeatureSelectionMixin -> SelectorMixin -> _LearntSelectorMixin
And rename sklearn.feature_selection.{selector_mixin -> from_model}
2013-05-21 13:53:12 +10:00
Joel Nothman 489d294a87 ENH Feature selection should use CSC matrices 2013-05-07 22:31:23 +10:00
jnothman 2b57e4e52e Merge pull request #1935 from jnothman/base_filter_inv_transform
Small improvements to inverse_transform used in feature_selection.
2013-05-07 05:26:58 -07:00
Joel Nothman 1b07773ca7 DOC comment feature selection sparse inverse_transform 2013-05-07 16:00:06 +10:00
Joel Nothman 4fd975ce80 ENH sparse _BaseFilter.inverse_transform 2013-05-07 16:00:05 +10:00
Joel Nothman 14f22a91bb DOC Fix comment for _BaseFilter.inverse_transform 2013-05-07 16:00:05 +10:00
Joel Nothman 313193fb0f ENH _BaseFilter.inverse_transform should respect dtype 2013-05-07 16:00:04 +10:00
Joel Nothman 0480a66814 FIX ensure SelectPercentile only removes tied features in case of ties 2013-05-07 12:34:47 +10:00
Joel Nothman 7af4fd934e ENH call asarray on returned scores and pvalues 2013-05-07 12:15:11 +10:00
Jaques Grobler 2ffb484adb COSMIT pep8 2013-05-04 10:43:39 +02:00
Mikhail Korobov eae18a3784 PY3 fix metaclasses. See #1829. 2013-04-04 01:07:20 +06:00
Joel Nothman b80f6a80b0 ENH allow SelectKBest to select all features in a parameter search 2013-03-13 12:28:49 +01:00
Olivier Grisel 1967a0b323 P3K use six to have a python 2 & 3 compatible code base 2013-02-09 18:08:44 +01:00
Lars Buitinck 19ed9b0165 ENH refactor univariate feature selection
Gets rid of "duplicate p-values" warning with filters that don't
actually use p-values.
2013-02-03 20:04:23 +01:00
Andreas Mueller 9e3ef3985e DOC some sphinx fixes 2013-01-16 22:51:24 +01:00
Andreas Mueller 69210dabfd COSMIT doc formating 2013-01-06 15:24:58 +01:00
Andreas Mueller 754c2d9533 COSMIT pep8 2012-12-22 16:48:17 +01:00