jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
recommender_mock.hpp
Go to the documentation of this file.
1 // Jubatus: Online machine learning framework for distributed environment
2 // Copyright (C) 2012 Preferred Networks and Nippon Telegraph and Telephone Corporation.
3 //
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License version 2.1 as published by the Free Software Foundation.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 
17 #ifndef JUBATUS_CORE_RECOMMENDER_RECOMMENDER_MOCK_HPP_
18 #define JUBATUS_CORE_RECOMMENDER_RECOMMENDER_MOCK_HPP_
19 
20 #include <string>
21 #include <utility>
22 #include <vector>
23 #include "jubatus/util/lang/shared_ptr.h"
24 #include "recommender_base.hpp"
26 
27 namespace jubatus {
28 namespace core {
29 namespace recommender {
30 
32  public:
35 
37  virtual ~recommender_mock();
38 
40  const common::sfv_t& query,
41  const std::vector<std::pair<std::string, float> >& ids);
43  const std::string& id,
44  const std::vector<std::pair<std::string, float> >& ids);
46  const common::sfv_t& query,
47  const std::vector<std::pair<std::string, float> >& ids);
49  const std::string& id,
50  const std::vector<std::pair<std::string, float> >& ids);
51 
52  virtual void similar_row(
53  const common::sfv_t& query,
54  std::vector<std::pair<std::string, float> >& ids,
55  size_t ret_num) const;
56  virtual void neighbor_row(
57  const common::sfv_t& query,
58  std::vector<std::pair<std::string, float> >& ids,
59  size_t ret_num) const;
60  virtual void clear();
61  virtual void clear_row(const std::string& id);
62  virtual void update_row(const std::string& id, const sfv_diff_t& diff);
63  virtual void get_all_row_ids(std::vector<std::string>& ids) const;
64 
65  virtual std::string type() const;
67 
68  void pack(framework::packer& packer) const;
69  void unpack(msgpack::object o);
70 
71  private:
72  jubatus::util::lang::shared_ptr<mixable_recommender_mock_storage>
74 };
75 
76 } // namespace recommender
77 } // namespace core
78 } // namespace jubatus
79 
80 #endif // JUBATUS_CORE_RECOMMENDER_RECOMMENDER_MOCK_HPP_
void pack(framework::packer &packer) const
void set_similar_relation(const common::sfv_t &query, const std::vector< std::pair< std::string, float > > &ids)
virtual void similar_row(const common::sfv_t &query, std::vector< std::pair< std::string, float > > &ids, size_t ret_num) const =0
virtual void similar_row(const common::sfv_t &query, std::vector< std::pair< std::string, float > > &ids, size_t ret_num) const
core::common::sfv_t sfv_diff_t
virtual void clear_row(const std::string &id)
virtual void neighbor_row(const common::sfv_t &query, std::vector< std::pair< std::string, float > > &ids, size_t ret_num) const
virtual void get_all_row_ids(std::vector< std::string > &ids) const
void set_neighbor_relation(const common::sfv_t &query, const std::vector< std::pair< std::string, float > > &ids)
msgpack::packer< jubatus_packer > packer
Definition: bandit_base.hpp:31
virtual void neighbor_row(const common::sfv_t &query, std::vector< std::pair< std::string, float > > &ids, size_t ret_num) const =0
std::vector< std::pair< std::string, float > > sfv_t
Definition: type.hpp:29
jubatus::util::lang::shared_ptr< mixable_recommender_mock_storage > mixable_storage_
virtual void update_row(const std::string &id, const sfv_diff_t &diff)