powered by
Function to calculate the inverse document frequency given a shingled bag of words
calc_idf(sack_of_bags)
Sack of bag of words
Computes the inverse document frequency for a bag of words
# NOT RUN { 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)) # }
Run the code above in your browser using DataLab