50% off | Unlimited Data & AI Learning

Last chance! 50% off unlimited learning

Sale ends in


jmotif (version 1.1.1)

bags_to_tfidf: Computes a TF-IDF weight vectors for a set of word bags.

Description

Computes a TF-IDF weight vectors for a set of word bags.

Usage

bags_to_tfidf(data)

Arguments

data

the list containing the input word bags.

References

Senin Pavel and Malinchik Sergey, SAX-VSM: Interpretable Time Series Classification Using SAX and Vector Space Model. Data Mining (ICDM), 2013 IEEE 13th International Conference on, pp.1175,1180, 7-10 Dec. 2013.

Salton, G., Wong, A., Yang., C., A vector space model for automatic indexing. Commun. ACM 18, 11, 613-620, 1975.

Examples

Run this code
# NOT RUN {
bag1 = data.frame(
   "words" = c("this", "is", "a", "sample"),
   "counts" = c(1, 1, 2, 1),
   stringsAsFactors = FALSE
   )
bag2 = data.frame(
   "words" = c("this", "is", "another", "example"),
   "counts" = c(1, 1, 2, 3),
   stringsAsFactors = FALSE
   )
ll = list("bag1" = bag1, "bag2" = bag2)
tfidf = bags_to_tfidf(ll)
# }

Run the code above in your browser using DataLab