jubatus_core  0.1.2
Jubatus: Online machine learning framework for distributed environment
clustering_config.hpp
Go to the documentation of this file.
1 // Jubatus: Online machine learning framework for distributed environment
2 // Copyright (C) 2013 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_CLUSTERING_CLUSTERING_CONFIG_HPP_
18 #define JUBATUS_CORE_CLUSTERING_CLUSTERING_CONFIG_HPP_
19 
20 #include <string>
21 #include <msgpack.hpp>
22 #include "jubatus/util/data/serialization.h"
23 #include "jubatus/util/text/json.h"
24 
25 namespace jubatus {
26 namespace core {
27 namespace clustering {
28 
31  : k(2),
32  compressor_method("simple"),
33  bucket_size(10000),
34  bucket_length(2),
37  forgetting_factor(2.0),
38  forgetting_threshold(0.05) {
39  }
40 
41  int k;
42 
43  std::string compressor_method;
44 
51 
53  k,
54  compressor_method,
55  bucket_size,
56  bucket_length,
57  bicriteria_base_size,
58  compressed_bucket_size,
59  forgetting_factor,
60  forgetting_threshold);
61 
62  template<typename Ar>
63  void serialize(Ar& ar) {
64  ar & JUBA_MEMBER(k)
65  & JUBA_MEMBER(compressor_method)
66  & JUBA_MEMBER(bucket_size)
67  & JUBA_MEMBER(bucket_length)
68  & JUBA_MEMBER(bicriteria_base_size)
69  & JUBA_MEMBER(compressed_bucket_size)
70  & JUBA_MEMBER(forgetting_factor)
71  & JUBA_MEMBER(forgetting_threshold);
72  }
73 };
74 
75 } // namespace clustering
76 } // namespace core
77 } // namespace jubatus
78 
79 #endif // JUBATUS_CORE_CLUSTERING_CLUSTERING_CONFIG_HPP_
MSGPACK_DEFINE(k, compressor_method, bucket_size, bucket_length, bicriteria_base_size, compressed_bucket_size, forgetting_factor, forgetting_threshold)