Skip to content

Commit a196ea3

Browse files
committed
✍🏻 Improve docstring
1 parent f9d7d4c commit a196ea3

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

β€Žsrc/encoders/contrast_encoder/contrast_encoder.jlβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,9 @@ Fit a contrast encoing scheme on given data in `X`.
6666
- `mode=:dummy`: The type of encoding to use. Can be one of `:contrast`, `:dummy`, `:sum`, `:backward_diff`, `:forward_diff`, `:helmert` or `:hypothesis`.
6767
If `ignore=false` (features to be encoded are listed explictly in `features`), then this can be a vector of the same length as `features` to specify a different
6868
contrast encoding scheme for each feature
69-
- `buildmatrix=nothing`: A function that should take column name as a symbol and the number of levels as input and return a contrast or hypothesis matrix.
70-
Only relevant if `mode` is `:contrast` or `:hypothesis`.
69+
- `buildmatrix=nothing`: A function or other callable with signature `buildmatrix(colname, k)`,
70+
where `colname` is the name of the feature levels and `k` is it's length, and which returns contrast or
71+
hypothesis matrix with row/column ordering consistent with the ordering of `levels(col)`. Only relevant if `mode` is `:contrast` or `:hypothesis`.
7172
- `ignore=true`: Whether to exclude or includes the features given in `features`
7273
- `ordered_factor=false`: Whether to encode `OrderedFactor` or ignore them
7374

β€Žsrc/encoders/contrast_encoder/interface_mlj.jlβ€Ž

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,9 @@ Train the machine using `fit!(mach, rows=...)`.
9797
- `mode=:dummy`: The type of encoding to use. Can be one of `:contrast`, `:dummy`, `:sum`, `:backward_diff`, `:forward_diff`, `:helmert` or `:hypothesis`.
9898
If `ignore=false` (features to be encoded are listed explictly in `features`), then this can be a vector of the same length as `features` to specify a different
9999
contrast encoding scheme for each feature
100-
- `buildmatrix=nothing`: A function that takes a vector of levels and the number of levels as input and should return a contrast or hypothesis matrix.
101-
Only relevant if `mode` is `:contrast` or `:hypothesis`.
100+
- `buildmatrix=nothing`: A function or other callable with signature `buildmatrix(colname, k)`,
101+
where `colname` is the name of the feature levels and `k` is it's length, and which returns contrast or
102+
hypothesis matrix with row/column ordering consistent with the ordering of `levels(col)`. Only relevant if `mode` is `:contrast` or `:hypothesis`.
102103
- `ignore=true`: Whether to exclude or includes the features given in `features`
103104
- `ordered_factor=false`: Whether to encode `OrderedFactor` or ignore them
104105

0 commit comments

Comments
Β (0)