From 6f2aa170cef2daff1e3c6297c688987c1a7550a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Sat, 4 Nov 2023 19:25:30 +0100 Subject: [PATCH] Clarify implementations --- lib/scholar/manifold/tsne.ex | 4 +--- lib/scholar/neighbors/k_nearest_neighbors.ex | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/scholar/manifold/tsne.ex b/lib/scholar/manifold/tsne.ex index 626ca990..fbebf650 100644 --- a/lib/scholar/manifold/tsne.ex +++ b/lib/scholar/manifold/tsne.ex @@ -2,9 +2,7 @@ defmodule Scholar.Manifold.TSNE do @moduledoc """ 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). + This is an exact implementation of t-SNE and therefore it has time complexity is $O(N^2)$ for $N$ samples. ## Reference diff --git a/lib/scholar/neighbors/k_nearest_neighbors.ex b/lib/scholar/neighbors/k_nearest_neighbors.ex index 6528e144..a41ee5c8 100644 --- a/lib/scholar/neighbors/k_nearest_neighbors.ex +++ b/lib/scholar/neighbors/k_nearest_neighbors.ex @@ -2,8 +2,8 @@ defmodule Scholar.Neighbors.KNearestNeighbors do @moduledoc """ The K-Nearest Neighbors. - It implements both classification and regression. The time complexity is - $O(N^2)$ for $N$ samples. + 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. """ import Nx.Defn import Scholar.Shared