17 #ifndef JUBATUS_CORE_ANOMALY_LIGHT_LOF_HPP_
18 #define JUBATUS_CORE_ANOMALY_LIGHT_LOF_HPP_
23 #include "jubatus/util/data/serialization.h"
24 #include "jubatus/util/data/unordered_set.h"
25 #include "jubatus/util/lang/shared_ptr.h"
36 namespace nearest_neighbor {
57 & JUBA_MEMBER(nearest_neighbor_num)
58 & JUBA_MEMBER(reverse_nearest_neighbor_num);
64 const std::string&
id,
65 jubatus::util::lang::shared_ptr<nearest_neighbor::nearest_neighbor_base>
66 nearest_neighbor_engine);
70 const std::string&
id,
71 jubatus::util::lang::shared_ptr<nearest_neighbor::nearest_neighbor_base>
72 nearest_neighbor_engine,
73 jubatus::util::lang::shared_ptr<unlearner::unlearner_base>
unlearner);
89 std::string
type()
const;
93 void unpack(msgpack::object o);
106 void touch(
const std::string&
id);
107 void unlearn(
const std::string&
id);
111 std::vector<float>& neighbor_lrds)
const;
113 const std::string& query,
114 std::vector<float>& neighbor_lrds)
const;
116 const std::vector<std::pair<std::string, float> >& neighbors,
117 std::vector<float>& neighbor_lrd)
const;
120 const std::string& query,
121 jubatus::util::data::unordered_set<std::string>& neighbors)
const;
123 const jubatus::util::data::unordered_set<std::string>& neighbors);
129 jubatus::util::lang::shared_ptr<nearest_neighbor::nearest_neighbor_base>
131 jubatus::util::lang::shared_ptr<unlearner::unlearner_base>
unlearner_;
134 jubatus::util::lang::shared_ptr<framework::mixable_versioned_table>
137 jubatus::util::lang::shared_ptr<framework::mixable_versioned_table>
148 #endif // JUBATUS_CORE_ANOMALY_LIGHT_LOF_HPP_
bool is_updatable() const
float collect_lrds_from_neighbors(const std::vector< std::pair< std::string, float > > &neighbors, std::vector< float > &neighbor_lrd) const
jubatus::util::lang::shared_ptr< nearest_neighbor::nearest_neighbor_base > nearest_neighbor_engine_
jubatus::util::lang::shared_ptr< framework::mixable_versioned_table > mixable_scores_
int reverse_nearest_neighbor_num
void set_row(const std::string &id, const common::sfv_t &sfv)
parameter get_row_parameter(const std::string &row) const
void touch(const std::string &id)
void pack(framework::packer &packer) const
light_lof(const config &config, const std::string &id, jubatus::util::lang::shared_ptr< nearest_neighbor::nearest_neighbor_base > nearest_neighbor_engine)
void update_row(const std::string &id, const sfv_diff_t &diff)
jubatus::util::lang::shared_ptr< framework::mixable_versioned_table > mixable_nearest_neighbor_
jubatus::util::data::optional< std::string > unlearner
void clear_row(const std::string &id)
msgpack::packer< jubatus_packer > packer
float collect_lrds(const common::sfv_t &query, std::vector< float > &neighbor_lrds) const
float calc_anomaly_score(const common::sfv_t &query) const
void update_entries(const jubatus::util::data::unordered_set< std::string > &neighbors)
void unlearn(const std::string &id)
std::vector< std::pair< std::string, float > > sfv_t
jubatus::util::lang::shared_ptr< unlearner::unlearner_base > unlearner_
void collect_neighbors(const std::string &query, jubatus::util::data::unordered_set< std::string > &neighbors) const
std::vector< framework::mixable * > get_mixables() const
void get_all_row_ids(std::vector< std::string > &ids) const
void unpack(msgpack::object o)