21 #include "../common/type.hpp"
27 using std::stringstream;
32 namespace fv_converter {
37 bool operator()(
const pair<string, float>& p) {
46 document_frequencies_(),
52 for (sfv_t::const_iterator it = fv.begin(); it != fv.end(); ++it) {
62 weight_t::const_iterator wit =
weights_.find(key);
89 for (weight_t::const_iterator it =
weights_.begin();
92 ss << it->first <<
" => " << it->second << std::endl;
jubatus::util::data::unordered_map< std::string, float > weight_t
void merge(const keyword_weights &w)
counter< std::string > document_frequencies_
float get_user_weight(const std::string &key) const
std::string to_string() const
void update_document_frequency(const common::sfv_t &fv)
void add_weight(const std::string &key, float weight)
std::vector< std::pair< std::string, float > > sfv_t
void add(const counter< T > &counts)