Skip to content

Commit 2e99e7b

Browse files
committed
Set categ=false in OneHot by default
1 parent 2c9692a commit 2e99e7b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/transforms/onehot.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# ------------------------------------------------------------------
44

55
"""
6-
OneHot(col; categ=true)
6+
OneHot(col; categ=false)
77
88
Transforms categorical column `col` into one-hot columns of levels
99
returned by the `levels` function of CategoricalArrays.jl.
@@ -16,7 +16,7 @@ columns to categorical arrays as opposed to boolean vectors.
1616
OneHot(1)
1717
OneHot(:a)
1818
OneHot("a")
19-
OneHot("a", categ=false)
19+
OneHot("a", categ=true)
2020
```
2121
"""
2222
struct OneHot{S<:ColSpec} <: StatelessFeatureTransform
@@ -28,7 +28,7 @@ struct OneHot{S<:ColSpec} <: StatelessFeatureTransform
2828
end
2929
end
3030

31-
OneHot(col; categ=true) = OneHot(col, categ)
31+
OneHot(col; categ=false) = OneHot(col, categ)
3232

3333
assertions(transform::OneHot) = [SciTypeAssertion{Finite}(transform.colspec)]
3434

test/shows.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,14 @@
200200

201201
# compact mode
202202
iostr = sprint(show, T)
203-
@test iostr == "OneHot([:a], true)"
203+
@test iostr == "OneHot([:a], false)"
204204

205205
# full mode
206206
iostr = sprint(show, MIME("text/plain"), T)
207207
@test iostr == """
208208
OneHot transform
209209
├─ colspec = [:a]
210-
└─ categ = true"""
210+
└─ categ = false"""
211211
end
212212

213213
@testset "Identity" begin

0 commit comments

Comments
 (0)