Skip to content

Commit

Permalink
Add more time complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Nov 2, 2023
1 parent 5ad9e5a commit 80e8889
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lib/scholar/manifold/tsne.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
defmodule Scholar.Manifold.TSNE do
@moduledoc """
TSNE (t-Distributed Stochastic Neighbor Embedding) is a nonlinear dimensionality reduction technique.
t-SNE (t-Distributed Stochastic Neighbor Embedding) is a nonlinear dimensionality reduction technique.
The time complexity is $O(N^2)$ for $N$ samples. There are known $O(N*\\log(N))$ implementations but
those use tree structures which are not available in Nx (as Nx algorithms are also designed to run on
the GPU).
## Reference
Expand Down
9 changes: 6 additions & 3 deletions lib/scholar/neighbors/k_nearest_neighbors.ex
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
defmodule Scholar.Neighbors.KNearestNeighbors do
@moduledoc """
The K-Nearest Neighbors. It implements both classification and regression.
The K-Nearest Neighbors.
It implements both classification and regression. The time complexity is
$O(N^2)$ for $N$ samples.
"""
import Nx.Defn
import Scholar.Shared
Expand Down Expand Up @@ -162,7 +165,7 @@ defmodule Scholar.Neighbors.KNearestNeighbors do
## Return Values
It returns a tensor with predicted class labels
It returns a tensor with predicted class labels.
## Examples
Expand Down Expand Up @@ -210,7 +213,7 @@ defmodule Scholar.Neighbors.KNearestNeighbors do
## Return Values
It returns a tensor with probabilities of classes. They are arranged in lexicographic order.
It returns a tensor with probabilities of classes. They are arranged in lexicographic order.
## Examples
Expand Down

0 comments on commit 80e8889

Please sign in to comment.