[][src]Struct hotsax::anomaly::Anomaly

pub struct Anomaly<'a, N: Float> { /* fields omitted */ }

Provides easy access to the HOT SAX and brute force algorithms, by using the builder pattern. The only necessary algorithmic parameter is the size of the discord itself. The rest have default values, namely:

  • sax_word_length = 3
  • alpha = 3
  • use_brute_force = false

Methods

impl<'a, N: Float> Anomaly<'a, N>[src]

pub fn with(data: &'a Vec<N>, discord_size: usize) -> Self[src]

Sets up the data and the discord size to be used.

By default it uses:

  • sax_word_length: 3
  • alpha: 3
  • algo: Algorithm::HOTSAX
  • dim_reduce: 0 (disabled)

pub fn use_algo(&mut self, algo: Algorithm) -> &mut Self[src]

Determines the exact algorithm to use.

pub fn sax_word_length(&mut self, n: usize) -> &mut Self[src]

Sets the length of the SAX words to use.

pub fn use_slice(&mut self, range: impl RangeBounds<usize>) -> &mut Self[src]

Specifies to only use a slice of the dataset.

pub fn dim_reduce(&mut self, new_len: usize) -> &mut Self[src]

Applies PAA to the data. This is only useful if run with the bruteforce algorithm in mind.

pub fn alpha(&mut self, n: usize) -> &mut Self[src]

Sets the alphabet size to be used. The only valid values should be in the range 3..=7.

Panics

  • When n is set to an invalid value.

pub fn find_largest_discord(&self) -> Option<(f64, usize)>[src]

Finds the largest discord. If one couldn't be found, this function returns a None instead.

pub fn find_n_largest_discords(&self, discord_amnt: usize) -> Vec<(f64, usize)>[src]

Finds the top n largest discords. The vector returned can have less than n elements if less than n discords could be found.

pub fn find_discords_min_dist(&self, min_dist: f64) -> Vec<(f64, usize)>[src]

Finds all discords with a measured distance above min_dist.

Auto Trait Implementations

impl<'a, N> RefUnwindSafe for Anomaly<'a, N> where
    N: RefUnwindSafe

impl<'a, N> Send for Anomaly<'a, N> where
    N: Sync

impl<'a, N> Sync for Anomaly<'a, N> where
    N: Sync

impl<'a, N> Unpin for Anomaly<'a, N>

impl<'a, N> UnwindSafe for Anomaly<'a, N> where
    N: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,