Skip to content

Commit

Permalink
Improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 20, 2023
1 parent d030f00 commit 410ced4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
14 changes: 0 additions & 14 deletions benchmarks/kd_tree.exs

This file was deleted.

4 changes: 3 additions & 1 deletion lib/scholar/neighbors/k_nearest_neighbors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ defmodule Scholar.Neighbors.KNearestNeighbors do
The K-Nearest Neighbors.
It implements both classification and regression. This implements the linear
version of kNN and therefore it has time complexity $O(N^2)$ for $N$ samples.
(brute) version of kNN and therefore it has time complexity $O(N^2)$ for $N$
samples. See `Scholar.Neighbors.KDTree` for an alternative implementation which
is also exact.
"""
import Nx.Defn
import Scholar.Shared
Expand Down
2 changes: 2 additions & 0 deletions lib/scholar/neighbors/kd_tree.ex
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ defmodule Scholar.Neighbors.KDTree do
Implements a kd-tree, a space-partitioning data structure for organizing points
in a k-dimensional space.
It can be used to predict the K-Nearest Neighbors of a given input.
This is implemented as one-dimensional tensor with indices pointed to highest
dimension of the given tensor. Traversal starts by calling `root/0` and then
accessing the `left_child/1` and `right_child/1`. The tree is left-balanced.
Expand Down
4 changes: 2 additions & 2 deletions lib/scholar/neighbors/radius_nearest_neighbors.ex
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ defmodule Scholar.Neighbors.RadiusNearestNeighbors do
## Return Values
It returns a tensor with predicted class labels
It returns a tensor with predicted class labels.
## Examples
Expand Down Expand Up @@ -258,7 +258,7 @@ defmodule Scholar.Neighbors.RadiusNearestNeighbors do
## Return Values
Returns indices of the selected neighbor points as a mask (1 if a point is a neighbor, 0 otherwise) and their respective distances.
Returns indices of the selected neighbor points as a mask (1 if a point is a neighbor, 0 otherwise) and their respective distances.
## Examples
Expand Down

0 comments on commit 410ced4

Please sign in to comment.