MCPcopy Create free account
hub / github.com/davisking/dlib / expected

Function expected

dlib/test/feature_hashing.cpp:28–34  ·  view source on GitHub ↗

The expected counts, from the n-grams written out by hand.

Source from the content-addressed store, hash-verified

26
27 // The expected counts, from the n-grams written out by hand.
28 sparse_type expected (const std::vector<std::string>& ngrams, unsigned long num_buckets)
29 {
30 std::map<unsigned long,double> counts;
31 for (const auto& s : ngrams)
32 counts[bucket(s, num_buckets)] += 1;
33 return sparse_type(counts.begin(), counts.end());
34 }
35
36// ----------------------------------------------------------------------------------------
37

Callers 3

test_word_ngramsFunction · 0.85
test_char_ngramsFunction · 0.85
test_ngram_listsFunction · 0.85

Calls 3

bucketFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected