Skip to content

OneHotEncoder with missing values or Type #450

@olivierlabayle

Description

@olivierlabayle

Hello,

I think the following results in the case of missing values (or even just a type being a Union{Missing, Any}) are not expected. No error is thrown but the output is not encoded.

# With a missing value
A = (a=categorical(["a", "b", "a", missing]),)
mach = machine(OneHotEncoder(), A)
fit!(mach)
transform(mach)

# No more missing value but the type of A.a is still a union of missing
A.a[end] = "b"
mach = machine(OneHotEncoder(), A)
fit!(mach)
transform(mach)

Wouldn't it just make sense to skip missing values?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions