#[non_exhaustive]pub struct Shapelet {
pub values: Vec<f64>,
pub series_idx: usize,
pub start: usize,
pub length: usize,
pub quality: f64,
}Expand description
A discovered shapelet: a z-normalized discriminative subsequence plus its provenance in the training set.
The values are stored already z-normalized so that shapelet_distance
(and downstream transform/predict paths) never re-normalize the shapelet
against test statistics.
quality is a placeholder here (0.0); it is populated by the discovery phase
(Phase 58) with a discriminative score (higher = better).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.values: Vec<f64>Z-normalized subsequence values.
series_idx: usizeIndex of the source training series this shapelet was extracted from.
start: usizeStart offset of the subsequence within the source series.
length: usizeLength L of the subsequence.
quality: f64Discriminative quality score (higher = better). 0.0 until set in discovery.
Implementations§
Source§impl Shapelet
impl Shapelet
Sourcepub fn from_source(
series: &[f64],
series_idx: usize,
start: usize,
length: usize,
) -> Result<Self, FdarError>
pub fn from_source( series: &[f64], series_idx: usize, start: usize, length: usize, ) -> Result<Self, FdarError>
Build a shapelet from a source series slice, z-normalizing the window
series[start .. start + length] and recording provenance.
quality is initialized to 0.0 (set later during discovery).
§Errors
Returns FdarError::InvalidDimension if length == 0 or the window
[start, start + length) does not lie within series.
Trait Implementations§
impl StructuralPartialEq for Shapelet
Auto Trait Implementations§
impl Freeze for Shapelet
impl RefUnwindSafe for Shapelet
impl Send for Shapelet
impl Sync for Shapelet
impl Unpin for Shapelet
impl UnsafeUnpin for Shapelet
impl UnwindSafe for Shapelet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.