pub struct AnomalyDetector { /* private fields */ }Expand description
Watches for reflections the self-model did not see coming.
Implementations§
Source§impl AnomalyDetector
impl AnomalyDetector
pub fn new(alpha: f64) -> AnomalyDetector
pub fn observations(&self) -> u64
Sourcepub fn assess(
&mut self,
snapshot: &MirrorSnapshot,
predictions: &BTreeMap<(usize, usize), f64>,
) -> Surprise
pub fn assess( &mut self, snapshot: &MirrorSnapshot, predictions: &BTreeMap<(usize, usize), f64>, ) -> Surprise
Compare what was predicted against what arrived.
predictions maps cells to their predicted values. Cells without a
prediction are skipped rather than counted as perfectly predicted, which
would make a model that predicts nothing look infallible.
Sourcepub fn baseline(&self) -> f64
pub fn baseline(&self) -> f64
How surprising this machine usually is, for calibrating a threshold.
Sourcepub fn suggested_threshold(&self) -> f64
pub fn suggested_threshold(&self) -> f64
A threshold that would flag roughly the most unusual reflections, scaled to this machine rather than to a constant chosen in advance.
Trait Implementations§
Source§impl Clone for AnomalyDetector
impl Clone for AnomalyDetector
Source§impl Debug for AnomalyDetector
impl Debug for AnomalyDetector
Source§impl Default for AnomalyDetector
impl Default for AnomalyDetector
Source§impl<'de> Deserialize<'de> for AnomalyDetector
impl<'de> Deserialize<'de> for AnomalyDetector
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for AnomalyDetector
impl PartialEq for AnomalyDetector
Source§impl Serialize for AnomalyDetector
impl Serialize for AnomalyDetector
impl StructuralPartialEq for AnomalyDetector
Auto Trait Implementations§
impl Freeze for AnomalyDetector
impl RefUnwindSafe for AnomalyDetector
impl Send for AnomalyDetector
impl Sync for AnomalyDetector
impl Unpin for AnomalyDetector
impl UnsafeUnpin for AnomalyDetector
impl UnwindSafe for AnomalyDetector
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