Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WIP] Handle missing values in OrdinalEncoder #12045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 26 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
5ceb0e3
Implement handle missing functionality to _encode, OrdinalEncoder
maxcopeland Oct 8, 2018
3c00ba0
Spec'd out tests for different use cases
maxcopeland Dec 20, 2018
66033cc
Add force_all_finite parameter to _fit and _check_X
maxcopeland Dec 20, 2018
d640082
Add force_all_finite parameter to OrdinalEncoder
maxcopeland Dec 20, 2018
6787512
Update doc example to include force_all_finite in OrdinalEncoder inst…
maxcopeland Dec 20, 2018
b8ef08a
Allow object dtype to have NaN, edit test
maxcopeland Dec 20, 2018
cb854e6
Add force_all_finite param to _transform
maxcopeland Jan 9, 2019
d0253eb
Passthrough NaN's in numeric data is functional
maxcopeland Jan 10, 2019
0b68b32
Fix sorting error with nan's in _encode_python
maxcopeland Feb 25, 2019
f9c15c9
Add encode_missing param to docs and constructor
maxcopeland Feb 25, 2019
70cd187
Adding encode_missing param to OrdinalEncoder and appropriate tests
maxcopeland Feb 27, 2019
281350e
Add wrapper function to retain NaNs in encoded data and remove NaN's …
maxcopeland Feb 27, 2019
8474f4e
Add tests for label enc utils handle missing vals
maxcopeland Feb 27, 2019
dba626a
Give _encode ability to handle NaN's
maxcopeland Feb 28, 2019
6ca919d
Add encode_missing param, passing tests on numeric/object dtypes for …
maxcopeland Feb 28, 2019
ff6bc96
Check _check_X to fit and transform, clean up transform code
maxcopeland Feb 28, 2019
d3cd4dd
Spec out tests for inverse transform
maxcopeland Feb 28, 2019
9d64caa
Clean up test_encoders.py, remove test for nan raise error in ordinal…
maxcopeland Feb 28, 2019
15639e4
Clean up comments in OrdinalEncoder, comment out inverse transform te…
maxcopeland Feb 28, 2019
aecc96d
Fix merge conflicts
maxcopeland Mar 1, 2019
8f595fe
Merge branch 'master' into ordinal_enc_handle_missing
maxcopeland Mar 4, 2019
0f57fe6
Fix pep8 errors
maxcopeland Mar 4, 2019
d860e48
Fix assert_array_equal with nan in object dtype arrays. All tests in …
maxcopeland Mar 12, 2019
23fb738
Fix assert_array_equal with nan in object dtype arrays in test_encode…
maxcopeland Mar 12, 2019
b0aa000
Fix pep8 errors
maxcopeland Mar 12, 2019
7eed8c3
Merge branch 'ordinal_enc_handle_missing' of https://github.com/maxco…
maxcopeland Mar 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion doc/modules/preprocessing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ new feature of integers (0 to n_categories - 1)::
>>> enc = preprocessing.OrdinalEncoder()
>>> X = [['male', 'from US', 'uses Safari'], ['female', 'from Europe', 'uses Firefox']]
>>> enc.fit(X) # doctest: +ELLIPSIS
OrdinalEncoder(categories='auto', dtype=<... 'numpy.float64'>)
OrdinalEncoder(categories='auto', dtype=<... 'numpy.float64'>,
encode_missing=False)
>>> enc.transform([['female', 'from US', 'uses Safari']])
array([[0., 1., 1.]])

Expand Down
Loading