Skip to content
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

One Hot Encoder errors out if there are missing values even if there are no categorical features #3082

Closed
freddyaboulton opened this issue Nov 18, 2021 · 1 comment · Fixed by #3083
Assignees
Labels
bug Issues tracking problems with existing features.

Comments

@freddyaboulton
Copy link
Contributor

Repro

import pandas as pd
import woodwork as ww
from evalml.pipelines.components import OneHotEncoder
import pytest


df = pd.DataFrame({"a": [1.2, 2.3, 4.5, 6.7],
                   "b": [True, False, True, True],
                   "c": [4.5, 8.3, None, 4.3]})
df.ww.init(logical_types={"a": "Double",
                          "b": "Boolean",
                          "c": "Double"})

with pytest.raises(ValueError, match="Input contains NaN"):
    OneHotEncoder().fit_transform(df)

I would expect this to be a no-op since there are no categorical features in the data.

@freddyaboulton freddyaboulton added the bug Issues tracking problems with existing features. label Nov 18, 2021
@freddyaboulton freddyaboulton self-assigned this Nov 18, 2021
@freddyaboulton
Copy link
Contributor Author

This is the root cause of #2967

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues tracking problems with existing features.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant