pub struct ThresholdDecoder { /* private fields */ }Expand description
Decode cognitive states from topology metrics using learned thresholds.
Each cognitive state is associated with expected ranges for key topology metrics (mincut, modularity, efficiency, entropy). The decoder scores each candidate state by how well the input metrics fall within the expected ranges.
Implementations§
Source§impl ThresholdDecoder
impl ThresholdDecoder
Sourcepub fn set_threshold(
&mut self,
state: CognitiveState,
threshold: TopologyThreshold,
)
pub fn set_threshold( &mut self, state: CognitiveState, threshold: TopologyThreshold, )
Set the threshold for a specific cognitive state.
Sourcepub fn learn_thresholds(
&mut self,
labeled_data: &[(TopologyMetrics, CognitiveState)],
)
pub fn learn_thresholds( &mut self, labeled_data: &[(TopologyMetrics, CognitiveState)], )
Learn thresholds from labeled topology data.
For each cognitive state present in the data, computes the min/max range of each metric with a 10% margin.
Sourcepub fn decode(&self, metrics: &TopologyMetrics) -> (CognitiveState, f64)
pub fn decode(&self, metrics: &TopologyMetrics) -> (CognitiveState, f64)
Decode the cognitive state from topology metrics.
Returns the best-matching state and a confidence score in [0, 1].
If no thresholds are defined, returns (Unknown, 0.0).
Sourcepub fn num_states(&self) -> usize
pub fn num_states(&self) -> usize
Number of states with defined thresholds.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ThresholdDecoder
impl RefUnwindSafe for ThresholdDecoder
impl Send for ThresholdDecoder
impl Sync for ThresholdDecoder
impl Unpin for ThresholdDecoder
impl UnsafeUnpin for ThresholdDecoder
impl UnwindSafe for ThresholdDecoder
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