12 #include <unordered_set>
33 const static std::string
id;
42 knn(std::shared_ptr<index::inverted_index> idx,
43 std::shared_ptr<index::forward_index> f_idx, uint16_t k,
44 std::unique_ptr<index::ranker> ranker,
bool weighted =
false);
50 void train(
const std::vector<doc_id>& docs)
override;
58 class_label
classify(doc_id d_id)
override;
63 void reset()
override;
72 const std::vector<std::pair<doc_id, double>>& scored,
73 const std::vector<std::pair<class_label, uint16_t>>& sorted)
const;
76 std::shared_ptr<index::inverted_index>
inv_idx_;
99 using std::runtime_error::runtime_error;
107 std::unique_ptr<classifier>
109 std::shared_ptr<index::forward_index>,
110 std::shared_ptr<index::inverted_index>);