betaEncoder: Likelihood encoding of categorical feautres and binary target...

Description Usage Arguments

Description

This function uses likelihood encoding to map categorical variables in to a numeric value such. The beta distrubution is used as a prior (the conjugate prior of the bernoulli distribution). The parameters of the prior are taken to be alpha = n*p and beta = n*(1-p) where n is the population size and p is the population mean. New values are mapped to a random value from the Beta(alpha+a, beta+b) with a being number of successes in the group and b being number failures.

Usage

1
betaEncoder(target, train_group, test_group, prior_strength = 1)

Arguments

target

target variable (default is NULL)

group

group variable

seed

random seed (default is sample(1e6, 1))


mattmotoki/kaggleUtils documentation built on May 8, 2019, 11:57 p.m.