KDTree class abstract

KD-tree - an algorithm that provides efficient data retrieval by splitting the whole searching space into partitions in form of binary tree which means that data querying on average will take O(log(n)) time

One can use this algorithm to perform KNN-search. It's recommended to use KDTree when the number of the input data columns is much less than the number of rows of the data - in this case, the search will be more efficient

Constructors

KDTree(DataFrame points, {int leafSize = 1, DType dtype = DType.float32, KDTreeSplitStrategy splitStrategy = KDTreeSplitStrategy.inOrder})
points Data points which will be used to build the tree.
factory
KDTree.fromIterable(Iterable<Iterable<num>> pointsSrc, {int leafSize = 1, DType dtype = DType.float32, KDTreeSplitStrategy splitStrategy = KDTreeSplitStrategy.inOrder})
pointsSrc Data points which will be used to build the tree.
factory
KDTree.fromJson(Map<String, dynamic> json)
Creates a KDTree instance from a JSON serializable representation of the tree. The constructor works in conjunction with saveAsJson method.
factory

Properties

dtype DType
Data type for internal representation of points
no setter
hashCode int
The hash code for this object.
no setterinherited
leafSize int
A number of points on a leaf node.
no setter
points → Matrix
Points which were used to build the kd-tree
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schemaVersion int?
Contains a version of the current json schema
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
query(Vector point, int k, [Distance distance = Distance.euclidean]) Iterable<Neighbour>
Returns k nearest neighbours for point
queryIterable(Iterable<num> point, int k, [Distance distance = Distance.euclidean]) Iterable<Neighbour>
Returns k nearest neighbours for point, point is Iterable unlike query method where point is Vector from ml_linalg library
saveAsJson(String filePath) Future<File>
Saves a json-serializable map into a newly created file with the path filePath
inherited
toJson() Map<String, dynamic>
Returns a json-serializable map
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited