pub struct UmapConfig {
pub n_neighbors: usize,
pub n_epochs: usize,
pub category_weight: f64,
pub min_dist: f64,
pub warm_start_anchor: f64,
pub seed: u64,
}Expand description
Hyperparameters for UmapSphereProjection.
These are the tunable knobs exposed to the auto-tuner. Non-tunable
constants (learning_rate, negative_sample_rate) stay at their
canonical UMAP defaults inside [fit_projection_for_config].
Fields§
§n_neighbors: usizek in the kNN graph (attractive term). Higher = more global structure.
n_epochs: usizeAdam optimization epochs. ~200 for corpora < 10k, ~400 for 50k+.
category_weight: f64Weight on the category supervision term. 0.0 = unsupervised UMAP. Positive values pull same-category items together and push different-category items apart. 1.0–3.0 is typical.
min_dist: f64How tightly neighbors may pack on the sphere. Larger values flatten the embedding kernel near zero, so clusters claim more territory — exactly what the territorial/cap-overlap metrics measure. 0.0 = near-maximal clumping; 0.1 is the canonical UMAP default.
warm_start_anchor: f64Weight on an attractive pull toward each point’s PCA warm-start position; 0.0 disables. Use small values (~0.01–0.1) on sparse corpora whose kNN graphs fragment into disconnected components, to keep the components’ global arrangement from drifting under unopposed repulsion. Intentionally not a tuner axis — it is a data-pathology escape hatch, not a search dimension.
seed: u64PRNG seed for negative sampling and tie-breaking.
Trait Implementations§
Source§impl Clone for UmapConfig
impl Clone for UmapConfig
Source§fn clone(&self) -> UmapConfig
fn clone(&self) -> UmapConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UmapConfig
impl Debug for UmapConfig
Source§impl Default for UmapConfig
impl Default for UmapConfig
Source§impl<'de> Deserialize<'de> for UmapConfigwhere
UmapConfig: Default,
impl<'de> Deserialize<'de> for UmapConfigwhere
UmapConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for UmapConfig
impl RefUnwindSafe for UmapConfig
impl Send for UmapConfig
impl Sync for UmapConfig
impl Unpin for UmapConfig
impl UnsafeUnpin for UmapConfig
impl UnwindSafe for UmapConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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