embedding_size: Propose the length of embedding vector for each embedded...

embedding_sizeR Documentation

Propose the length of embedding vector for each embedded feature.

Description

These functions returns proposed embedding sizes for each categorical feature. They are "rule of thumbs", so the are based on empirical rather than theoretical conclusions, and their parameters can look like "magic numbers". Nevertheless, when you don't know what embedding size will be "optimal", it's good to start with such kind of general rules.

Usage

embedding_size_google(x, max_size = 100)

embedding_size_fastai(x, max_size = 100)

Arguments

x

(integer) A vector with dictionary size for each feature

Value

Proposed embedding sizes.

References

Examples

dict_sizes <- dict_size(tiny_m5)
embedding_size_google(dict_sizes)
embedding_size_fastai(dict_sizes)


krzjoa/torchts documentation built on June 24, 2022, 5:30 a.m.