pub struct KnnGraph {
pub neighbors: Vec<NeighborList>,
pub n: usize,
pub k: usize,
pub metric: DistanceMetric,
pub provenance: Option<String>,
}Expand description
Portable k-nearest-neighbour graph: per-point indices and distances only.
Fields§
§neighbors: Vec<NeighborList>§n: usize§k: usize§metric: DistanceMetric§provenance: Option<String>Implementations§
Source§impl KnnGraph
impl KnnGraph
Sourcepub fn required_k_for_pacmap(n: usize, n_neighbors: usize) -> usize
pub fn required_k_for_pacmap(n: usize, n_neighbors: usize) -> usize
Minimum k for PaCMAP mid-near candidate window: min(n_neighbors + 50, n − 1).
Sourcepub fn validate(
&self,
data_n: usize,
required_k: usize,
metric: DistanceMetric,
) -> Result<(), KnnError>
pub fn validate( &self, data_n: usize, required_k: usize, metric: DistanceMetric, ) -> Result<(), KnnError>
Validate graph shape / metric for a consumer that needs required_k neighbours.
Sourcepub fn validate_for_pacmap(
&self,
data_n: usize,
n_neighbors: usize,
config_metric: DistanceMetric,
) -> Result<(), KnnError>
pub fn validate_for_pacmap( &self, data_n: usize, n_neighbors: usize, config_metric: DistanceMetric, ) -> Result<(), KnnError>
PaCMAP-oriented validation helper.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KnnGraph
impl RefUnwindSafe for KnnGraph
impl Send for KnnGraph
impl Sync for KnnGraph
impl Unpin for KnnGraph
impl UnsafeUnpin for KnnGraph
impl UnwindSafe for KnnGraph
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
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