23 #include "../anomaly/anomaly_factory.hpp"
24 #include "../anomaly/anomaly_base.hpp"
25 #include "../common/vector_util.hpp"
26 #include "../fv_converter/datum.hpp"
27 #include "../fv_converter/datum_to_fv_converter.hpp"
28 #include "../fv_converter/converter_config.hpp"
29 #include "../fv_converter/revert.hpp"
30 #include "../storage/storage_factory.hpp"
37 using jubatus::util::lang::shared_ptr;
44 shared_ptr<jubatus::core::anomaly::anomaly_base> anomaly_method,
45 shared_ptr<fv_converter::datum_to_fv_converter> converter)
46 : converter_(converter),
47 anomaly_(anomaly_method),
49 vector<framework::mixable*> mixables =
anomaly_->get_mixables();
50 for (
size_t i = 0; i < mixables.size(); i++) {
73 return make_pair(
id, this->
update(
id, d));
75 return make_pair(
id, this->
overwrite(
id, d));
84 return anomaly_->calc_anomaly_score(
id);
92 return anomaly_->calc_anomaly_score(
id);
103 return anomaly_->calc_anomaly_score(v);
123 if (o.type != msgpack::type::ARRAY || o.via.array.size != 2) {
124 throw msgpack::type_error();
130 anomaly_->unpack(o.via.array.ptr[0]);
fv_converter::mixable_weight_manager wm_
void unpack(msgpack::object o)
model_ptr get_model() const
jubatus::util::lang::shared_ptr< fv_converter::datum_to_fv_converter > converter_
float calc_score(const fv_converter::datum &d) const
jubatus::util::lang::shared_ptr< core::anomaly::anomaly_base > anomaly_
uint64_t find_max_int_id() const
std::pair< std::string, float > add(const std::string &id, const fv_converter::datum &d)
framework::linear_mixable_helper< weight_manager, versioned_weight_diff > mixable_weight_manager
float overwrite(const std::string &id, const fv_converter::datum &d)
anomaly(jubatus::util::lang::shared_ptr< core::anomaly::anomaly_base > anomaly_method, jubatus::util::lang::shared_ptr< fv_converter::datum_to_fv_converter > converter)
void clear_row(const std::string &id)
void pack(framework::packer &pk) const
std::vector< std::string > get_all_rows() const
std::vector< std::pair< std::string, float > > sfv_t
void register_mixable(framework::mixable *mixable)
float update(const std::string &id, const fv_converter::datum &d)
bool is_updatable() const
storage::mixable_lsh_index_storage::model_ptr model_ptr