pub struct UmapGraph { /* private fields */ }Expand description
Precomputed kNN graph for UMAP. Cacheable across configs that
share the same n_neighbors but differ in n_epochs,
category_weight, or min_dist — everything here is computed
before the optimizer, which is where those knobs act.
Implementations§
Source§impl UmapGraph
impl UmapGraph
Sourcepub fn build(
embeddings: &[Embedding],
n_neighbors: usize,
) -> Result<Self, ProjectionError>
pub fn build( embeddings: &[Embedding], n_neighbors: usize, ) -> Result<Self, ProjectionError>
Build the kNN graph and PCA warm-start from embeddings.
This is the expensive part of UMAP fit — O(N·log N·d) for the
ANN-backed graph + O(N·d) for PCA warm-start. The result is
reusable across all UMAP configs that share n_neighbors.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UmapGraph
impl RefUnwindSafe for UmapGraph
impl Send for UmapGraph
impl Sync for UmapGraph
impl Unpin for UmapGraph
impl UnsafeUnpin for UmapGraph
impl UnwindSafe for UmapGraph
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more