Commit Graph

20 Commits

Author SHA1 Message Date
Joris Van den Bossche fce73db57a FIX deprecation handling in OneHotEncoder for categorical_features + handle_unknown='ignore' case (#12923) 2019-01-15 16:34:55 +11:00
Andreas Mueller 952ef6637a MRG Drop legacy python / remove six dependencies (#12639) 2019-01-03 15:50:05 +02:00
Nicolas Hug a50c03f975 [MRG] Add pprint for estimators - continued (#11705)
* add pprint for estimators

* strip color from length, add color option

* Minor cleaning, fixes, factoring and docs

* Added some basic tests

* Fixed line length issue

* fixed flake8 and added visual test for review

* Fixed test

* Fixed Python 2 issues (inspect.signature import)

* Trying to fix flake8 again

* Added special repr for functions

* Added some other visual tests

* Changed _format_function in to _format_callable

because callable() returns True also for class objects (which we want to
reprensent with their name as well anyway)

* Consistent output in Python 2 and 3

* WIP

* Now using the builtin pprint module

* pep8

* Added changed_only param

* Fixed printing when string would fit in less than line width

* Fixed printing of steps parameter

* Fixed changed_only param for short estimators

* fixed pep8

* Added some more description in docstring

* changed_only is now an option from set_config()

* Put _pprint.py into sklearn/utils, added tests

* Added doctest NORMALIZE_WHITESPACE where needed

* Fixed tests

* fix test-doc

* fixing test that passed before....

* Fixed tests

* Added test for changed_only and long lines

* typo

* Added authors names

* Added license file

* Added ellipsis based on number of elements in sequence + added increasinly aggressive repr strategies

* Updated whatsnew

* dont use increaingly aggressive strategy

* Fixed tests

* Removed LICENSE file and put license text in _pprint.py

* fixed test_base

* Sorted parameters dictionary for consistent output in 3.5

* Actually using OrderedDict...

* Addressed comments

* Added test for NaN changed parameter

* Update whatsnew

* Added example to set_config()

* Removed example

* Added example in gallery

* Spelling
2018-12-19 23:48:21 -05:00
Gabriel Marzinotto 62117f482e Bug with string dtype in OneHotEncoder with handle_unknown='ignore' (#12471)
* fix decisionTree issue #12259

* merge splitters

* fix decisionTree issue #12259

* merge splitters

* relaunch tests

* fix for ohe string sizes

* reverse tree changes because not done yet

* error with file

* pylinting

* add regression test and check if categories are strings before casting to object

* pylint

* pylint

* another posibility to handle the strings

* pylint

* pylint

* pylint

* add issue reference and explain the test

* handle object case

* update master test

* update master test

* Update _encoders.py

pylint

* Update test_encoders.py

* Update test_encoders.py

* Update _encoders.py

* Update _encoders.py

* fix checking for object type

* fix checking for object type

* fix checking for object type

* fix checking for object type

* fix encoder

* change check encoder

* add note in whats new
2018-11-18 14:59:07 -05:00
Dillon Gardner 2afee939df FIX incorrect error when OneHotEncoder.transform called prior to fit (#12443) 2018-11-13 09:49:53 +11:00
Andreas Mueller eb36e4905a MNT Don't change self.n_values in OneHotEncoder.fit (#12286) 2018-11-11 16:41:30 +08:00
Matthew Roeschke 5af272ac61 MNT Remove unused variables (#12230) 2018-10-22 12:48:40 +11:00
Cheuk Ting Ho f5ef674f3d DOC improve OneHotEncoder documentation (#12314) 2018-10-15 08:08:25 +11:00
Joris Van den Bossche 1e7cd7df9d BUG Fix OrdinalEncoder with manually specified categories (#12367) 2018-10-13 21:45:19 +02:00
Rohan Singh 94c70ff235 [MRG] More informative error message in OneHotEncoder(categories=None) with negative integer values (#12180)
* Fix Issue #12179

OneHotEncoder "only non-negative integers" message should suggest using
categories='auto'

* Fix Issue #12179

    OneHotEncoder "only non-negative integers" message should suggest using
    categories='auto'

* Fix Issue #12179

OneHotEncoder "only non-negative integers" message should suggest using
categories='auto'

* Fixes #12180 Modify the error message

* Fix the spacing
2018-10-01 12:27:04 -04:00
Hanmin Qin 0bbd935748 DOC Typo in OneHotEncoder 2018-09-20 23:27:40 +08:00
Albert Thomas e1cf0db5a7 DOC Update fit_transform docstring of OneHotEncoder (#12117) 2018-09-20 23:24:05 +08:00
Joris Van den Bossche dfdf605f67 BUG always raise on NaN in OneHotEncoder for object dtype data (#12033) 2018-09-13 14:50:08 +02:00
Nirvan Anjirbag 61fa3155da [MRG] Add get_feature_names to OneHotEncoder (#10198)
**Reference Issues/PRs**
Fixes #10181 

**What does this implement/fix? Explain your changes.**
Added function **get_feature_names()** to **CategoricalEncoder** class. This is in `data.py` under `sklearn.preprocessing` 


<!--
Please be aware that we are a loose team of volunteers so patience is
necessary; assistance handling other issues is very welcome. We value
all user contributions, no matter how minor they are. If we are slow to
review, either the pull request needs some benchmarking, tinkering,
convincing, etc. or more likely the reviewers are simply busy. In either
case, we ask for your understanding during the review process.
For more information, see our FAQ on this topic:
http://scikit-learn.org/dev/faq.html#why-is-my-pull-request-not-getting-any-attention.

Thanks for contributing!
-->
2018-07-16 15:02:49 -05:00
Andreas Mueller b25e222328 MNT misc sphinx website build fixes and dead links (#11532) 2018-07-16 09:13:20 +08:00
Hanmin Qin d1e26155e1 Merge branch 'master' into discrete 2018-07-10 10:02:46 +08:00
Joel Nothman bb719e188c Move _transform_selected helper to base.py 2018-07-10 09:52:25 +10:00
Joris Van den Bossche 0b0bd9b369 [MRG] Use hashtable (python sets/dicts) for object dtype data in Encoders (#10209) 2018-07-03 09:51:07 +02:00
Joris Van den Bossche e93cde5739 FIX OneHot/OrdinalEncoder: correctly coerced dtype of passed categories (#11347) 2018-06-28 09:36:44 +10:00
Joris Van den Bossche 007aa710bd FEA Refactor CategoricalEncoder into OneHotEncoder and OrdinalEncoder (#10523)
Deprecated some OneHotEncoder behaviour
2018-06-21 19:27:41 +10:00