sim_postcode_levels: Simulate the levels and their sizes in a high-cardinality...

View source: R/sim.R

sim_postcode_levelsR Documentation

Simulate the levels and their sizes in a high-cardinality feature

Description

Simulate the levels and their sizes in a high-cardinality feature

Usage

sim_postcode_levels(nlevels = 100L, seed = 1001)

Arguments

nlevels

Number of levels to generate.

seed

Random seed.

Value

A data frame of postal codes and sizes.

Note

The code is derived from the example described in the "rare levels" vignette in the vtreat package.

Examples

df_levels <- sim_postcode_levels(nlevels = 500, seed = 42)
head(df_levels)

nanxstats/oneclust documentation built on March 14, 2024, 6:27 a.m.