24 #include "jubatus/util/lang/function.h"
25 #include "jubatus/util/lang/bind.h"
27 #include "../common/jsonconfig.hpp"
31 using jubatus::util::lang::shared_ptr;
38 const std::string& name,
50 "method = gmm, compressor_method != compressive_kmeans"));
54 if (method ==
"kmeans" &&
57 "method = kmeans, compressor_method != compressive_gmm"));
78 "1 <= bicriteria_base_size < compressed_bucket_size"));
94 "0.0 <= forgetting_threshold <= 1.0"));
100 clustering::~clustering() {
103 void clustering::init() {
109 void clustering::set_storage(shared_ptr<storage>
storage) {
112 this, jubatus::util::lang::_1,
true));
113 storage->add_event_listener(
UPDATE,
115 this, jubatus::util::lang::_1,
false));
119 jubatus::util::lang::shared_ptr<storage> clustering::get_storage() {
123 void clustering::update_clusters(
const wplist& points,
bool batch) {
131 void clustering::set_clustering_method(
136 bool clustering::push(
const std::vector<weighted_point>& points) {
137 jubatus::util::lang::shared_ptr<storage> sto =
storage_->get_model();
138 for (std::vector<weighted_point>::const_iterator it = points.begin();
139 it != points.end(); ++it) {
146 return storage_->get_model()->get_all();
149 std::vector<common::sfv_t> clustering::get_k_center()
const {
159 if (clustering_id == -1) {
165 std::vector<wplist> clustering::get_core_members()
const {
169 size_t clustering::get_revision()
const {
170 return storage_->get_model()->get_revision();
177 std::string clustering::type()
const {
185 void clustering::unpack(msgpack::object o) {
189 void clustering::clear() {
193 void clustering::do_clustering() {
double forgetting_threshold
wplist get_coreset() const
framework::linear_mixable_helper< storage, diff_t > mixable_storage
void set_storage(jubatus::util::lang::shared_ptr< storage > storage)
int compressed_bucket_size
#define JUBATUS_EXCEPTION(e)
static jubatus::util::lang::shared_ptr< storage > create(const std::string &name, const clustering_config &config)
std::string compressor_method
clustering_config config_
jubatus::util::lang::shared_ptr< clustering_method > clustering_method_
void update_clusters(const wplist &points, bool batch)
void set_clustering_method(jubatus::util::lang::shared_ptr< clustering_method > clustering_method)
std::vector< std::pair< std::string, float > > sfv_t
jubatus::util::lang::shared_ptr< mixable_storage > storage_
std::vector< weighted_point > wplist
static jubatus::util::lang::shared_ptr< clustering_method > create(const std::string &method, const clustering_config &config)