invenia / invenia/FeatureTransforms.jl

OneHotEncoding should retain metadata

Open
#57 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Julia
Stars
37
Forks
1
PR merge metrics
No merged PRs in 30d

Description

The current `OneHotEncoding` transform seems to always just return a NxP binary matrix despite knowing what the categories are and potentially being passed a type that would allow you to retain that info.

For example, if I have `OneHotEncoding(Hour(0):Hour(1):Hour(23))` and then I pass a dataframe with an `HoD` column, I could easily see that transform returning a new dataframe with a column name for each hour. Similarly, if we took a function argument, we could do something like:

```julia
FeatureTransforms.ohe(Hour, data; dims=:time)
```

This would return a new `KeyedArray` or `AxisArray` that retains the category information for the `p` dimension, and also uses the `dims` argument to mean use dimension keys for `KeyedArray`s or `AxisArrays`.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.