hashtrick: Hash Trick Functions for Model Building

Description Usage Arguments Value

Description

hashtrick builds a matrix using the hash trick, hash_col hashes a single column.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
hashtrick(..., m = 256L, algo = "md5", key = DEFAULT_KEY)

hash_col(x, m, algo, key)

## S3 method for class 'character'
hash_col(x, m, algo, key)

## S3 method for class 'numeric'
hash_col(x, m, algo, key)

## S3 method for class 'factor'
hash_col(x, m, algo, key)

Arguments

...

a list of variables

m

modulo - number of columns for result

algo

'md5' and others provided by OpenSSL

key

a list of raws. If provided, the hash function generates a different mapping

x

character vector to hash

Value

for hashtrick, a n-by-m matrix of the dummy coded features. For hash_col, a matrix containing hashes, one column per key provided.


nfultz/hashtrick documentation built on May 23, 2019, 4:41 p.m.