pub struct RandomProjection { /* private fields */ }Expand description
Fit-free projection via random matrix (Johnson-Lindenstrauss).
Generates a fixed 3×n random matrix at construction time. Preserves pairwise distances probabilistically without needing a training corpus. Less accurate than PCA for any specific dataset, but useful when no corpus is available or for quick prototyping.
Deterministic for a given seed.
Implementations§
Source§impl RandomProjection
impl RandomProjection
pub fn new(dim: usize, radial: RadialStrategy, seed: u64) -> Self
pub fn new_default(dim: usize) -> Self
Trait Implementations§
Source§impl Clone for RandomProjection
impl Clone for RandomProjection
Source§fn clone(&self) -> RandomProjection
fn clone(&self) -> RandomProjection
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Projection for RandomProjection
impl Projection for RandomProjection
fn project(&self, embedding: &Embedding) -> SphericalPoint
fn dimensionality(&self) -> usize
Source§fn project_rich(&self, embedding: &Embedding) -> ProjectedPoint
fn project_rich(&self, embedding: &Embedding) -> ProjectedPoint
Project with rich metadata: certainty, intensity, projection magnitude.
Auto Trait Implementations§
impl !RefUnwindSafe for RandomProjection
impl !UnwindSafe for RandomProjection
impl Freeze for RandomProjection
impl Send for RandomProjection
impl Sync for RandomProjection
impl Unpin for RandomProjection
impl UnsafeUnpin for RandomProjection
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