
Ordinal encoding (Geron Ch 2, morie.fn grord)
Source:R/geron_train_native.R
morie_geron_ordinal_encoding_grord.Rdenc(level k) = k, 0-based over the declared level order.
Examples
V <- c(1, 2, 3, 4, 5, 6, 7, 8)
morie_geron_ordinal_encoding_grord(V)
#> $encoded
#> [1] 0 1 2 3 4 5 6 7
#>
#> $levels
#> [1] 1 2 3 4 5 6 7 8
#>
#> $mapping
#> 1 2 3 4 5 6 7 8
#> 0 1 2 3 4 5 6 7
#>
#> $estimate
#> [1] 0 1 2 3 4 5 6 7
#>
#> $n
#> [1] 8
#>