rproject_bags: Function that generates unit random vectors and takes...

Description Usage Arguments Value Examples

View source: R/klsh.R

Description

Function that generates unit random vectors and takes (weighted) projections onto the random unit vectors given a bag of words

Usage

1
rproject_bags(sack_of_bags, weighting_table)

Arguments

sack_of_bags

Sack of bag of words

weighting_table

Weighting table (inverse document frequency)

Value

Computes the inverse document frequency for a bag of words

Examples

1
2
3
4
5
6
data(RLdata500)
data.500 <- RLdata500[-c(2,4)]
sack <- sacks_of_bags_of_words(data.500[1:3,c(-2)],k=2)
idf <- calc_idf(sack)
match(names(sack[[1]]), names(idf))
rproject_bags(sack, idf)

klsh documentation built on Jan. 13, 2021, 8:05 p.m.