6 #ifndef TURI_BALL_TREE_NEIGHBORS_H_ 7 #define TURI_BALL_TREE_NEIGHBORS_H_ 10 #include <toolkits/nearest_neighbors/nearest_neighbors.hpp> 13 #include <Eigen/SparseCore> 17 namespace nearest_neighbors {
50 std::vector<size_t> membership;
51 std::vector<DenseVector> pivots;
52 std::vector<SparseVector> pivots_sp;
53 std::vector<double> node_radii;
75 bool activate_query_node(
size_t k,
double radius,
double min_poss_dist,
76 size_t num_current_neighbors,
77 double max_current_dist)
const;
86 static constexpr
size_t BALL_TREE_NEIGHBORS_VERSION = 2;
100 void init_options(
const std::map<std::string,flexible_type>& _opts)
override;
111 void train(
const sframe& X,
const std::vector<flexible_type>& ref_labels,
112 const std::vector<dist_component_type>& composite_distance_params,
113 const std::map<std::string, flexible_type>& opts)
override;
134 sframe query(
const v2::ml_data& mld_queries,
135 const std::vector<flexible_type>& query_labels,
136 const size_t k,
const double radius,
137 const bool include_self_edges)
const override;
143 return BALL_TREE_NEIGHBORS_VERSION;
#define BEGIN_CLASS_MEMBER_REGISTRATION(python_facing_classname)
#define REGISTER_CLASS_MEMBER_FUNCTION(function,...)
The serialization input archive object which, provided with a reference to an istream, will read from the istream, providing deserialization capabilities.
#define END_CLASS_MEMBER_REGISTRATION
size_t get_version() const override
The serialization output archive object which, provided with a reference to an ostream, will write to the ostream, providing serialization capabilities.