23 #include "jubatus/util/lang/shared_ptr.h"
25 #include "../common/exception.hpp"
26 #include "../common/vector_util.hpp"
27 #include "../fv_converter/datum.hpp"
28 #include "../fv_converter/datum_to_fv_converter.hpp"
29 #include "../fv_converter/converter_config.hpp"
30 #include "../fv_converter/revert.hpp"
31 #include "../recommender/recommender_factory.hpp"
38 using jubatus::util::lang::shared_ptr;
45 shared_ptr<core::recommender::recommender_base> recommender_method,
46 shared_ptr<fv_converter::datum_to_fv_converter> converter)
47 : converter_(converter),
48 recommender_(recommender_method),
64 const std::string&
id,
97 const std::string&
id,
99 std::vector<std::pair<std::string, float> > ret;
104 std::vector<std::pair<std::string, float> >
111 std::vector<std::pair<std::string, float> > ret;
141 std::vector<std::string> ret;
153 if (o.type != msgpack::type::ARRAY || o.via.array.size != 2) {
154 throw msgpack::type_error();
static float calc_l2norm(const common::sfv_t &query)
model_ptr get_model() const
void revert_feature(const common::sfv_t &fv, fv_converter::datum &data)
std::vector< std::pair< std::string, float > > similar_row_from_datum(const fv_converter::datum &data, size_t size)
fv_converter::datum complete_row_from_id(const std::string &id)
void unpack(msgpack::object o)
void clear_row(const std::string &id)
jubatus::util::lang::shared_ptr< core::recommender::recommender_base > recommender_
void pack(framework::packer &pk) const
core::common::sfv_t sfv_diff_t
fv_converter::mixable_weight_manager wm_
std::vector< std::string > get_all_rows()
void update_row(const std::string &id, const fv_converter::datum &dat)
std::vector< std::pair< std::string, float > > similar_row_from_id(const std::string &id, size_t ret_num)
fv_converter::datum decode_row(const std::string &id)
framework::linear_mixable_helper< weight_manager, versioned_weight_diff > mixable_weight_manager
recommender(jubatus::util::lang::shared_ptr< core::recommender::recommender_base > method, jubatus::util::lang::shared_ptr< fv_converter::datum_to_fv_converter > converter)
float calc_similality(const fv_converter::datum &l, const fv_converter::datum &r)
jubatus::util::lang::shared_ptr< fv_converter::datum_to_fv_converter > converter_
float calc_l2norm(const fv_converter::datum &q)
std::vector< std::pair< std::string, float > > sfv_t
static float calc_similality(common::sfv_t &q1, common::sfv_t &q2)
fv_converter::datum complete_row_from_datum(const fv_converter::datum &dat)
void register_mixable(framework::mixable *mixable)
storage::mixable_lsh_index_storage::model_ptr model_ptr