tests/test-interpret.tag.R

if (require(RUnit)) {
  library(FeatureHashing)
  data(test.tag)
  system.time(tmp1 <- FeatureHashing:::split.character1(test.tag, ",", type = "existence"))
  system.time(tmp2 <- FeatureHashing:::split.character2(test.tag, ",", type = "existence"))
  checkTrue(isTRUE(all.equal(tmp1, tmp2)),
            "The split results (type existence) between R and C++ are inconsistent")
  
  system.time(tmp1 <- FeatureHashing:::split.character1(test.tag, ",", type = "count"))
  system.time(tmp2 <- FeatureHashing:::split.character2(test.tag, ",", type = "count"))
  checkTrue(isTRUE(all.equal(tmp1, tmp2)),
            "The split results (type count) between R and C++ are inconsistent")
}

Try the FeatureHashing package in your browser

Any scripts or data that you put into this service are public.

FeatureHashing documentation built on Oct. 31, 2022, 1:06 a.m.