Skip to main content

BridgeConfig

Struct BridgeConfig 

Source
pub struct BridgeConfig {
    pub threshold_base: f64,
    pub threshold_evr_penalty: f64,
    pub overlap_artifact_territorial: f64,
    pub balanced_affinity_quantile: f64,
    pub min_evr_for_classification: f64,
}
Expand description

Parameters controlling bridge detection and classification.

Fields§

§threshold_base: f64

Constant term in the EVR-adaptive bridge threshold threshold = threshold_base + (1 − evr)² · threshold_evr_penalty.

§threshold_evr_penalty: f64

EVR-penalty coefficient in the bridge threshold formula.

§overlap_artifact_territorial: f64

Percentile of the observed territorial factor distribution below which a bridge is classified as OverlapArtifact rather than Genuine or Weak. 0.3 = the bottom 30 % of bridge pairs by territorial separation are labeled artifacts. Expressed as a percentile so that dense corpora (where all exclusivities collapse toward zero) do not classify every bridge as an artifact.

§balanced_affinity_quantile: f64

Quantile of the home-affinity distribution that sets the genuine-bridge floor. For each member item, “home affinity” is the cosine similarity between the item’s embedding and its own category’s centroid. A bridge is classified Genuine when min(affinity_to_source, affinity_to_target) exceeds the quantile-q of those home affinities; otherwise Weak.

Why a quantile and not an absolute cosine: home affinity scale varies with the projection layout. After stratified PCA spreads imbalanced corpora, home affinities can drop into the 0.3–0.6 band where a fixed 0.5 cosine floor labels almost every cross- domain item Weak. A quantile-based floor adapts to the corpus’s own affinity scale: tight corpora get a strict floor, spread ones get a permissive one, without per-corpus tuning.

Smaller q = stricter (only bridges matching the strongest home affinities qualify). Larger q = more permissive. Default 0.25: a bridge is Genuine if it has at least as much affinity to both sides as the bottom-25% of items have to their own home category.

§min_evr_for_classification: f64

EVR below which bridge classification is unreliable. When the outer projection’s EVR is below this threshold, all bridges are labeled Weak (honest uncertainty) rather than attempting territorial-factor-based classification — which collapses to 100% OverlapArtifact when caps overlap everywhere on a low-EVR projection, flattening the tuner landscape. Default 0.20.

Implementations§

Source§

impl BridgeConfig

Source

pub fn evr_adaptive_threshold(&self, evr: f64) -> f64

EVR-adaptive bridge threshold.

Higher EVR → looser threshold (projection is more trustworthy). At EVR=0.19: 0.5 + 0.81² × 0.4 = 0.76 (strict). At EVR=0.90: 0.5 + 0.01 × 0.4 = 0.50 (essentially unchanged).

Trait Implementations§

Source§

impl Clone for BridgeConfig

Source§

fn clone(&self) -> BridgeConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for BridgeConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BridgeConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for BridgeConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for BridgeConfig

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more