#[non_exhaustive]pub struct ShapeletClassifierFit {
pub transform: ShapeletTransformFit,
pub classifier: ClassifFit,
pub config: ShapeletClassifierConfig,
pub classes: Vec<usize>,
}Expand description
A fitted shapelet-transform classifier: the discovered shapelet transform plus
the inner classifier trained on the n×K distance features.
Stores the (already z-normalized) shapelets and the fitted inner ClassifFit
so that predict reuses the identical shapelets, normalization,
and FPCA rotation as the fit.
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.transform: ShapeletTransformFitThe fitted shapelet transform (discovered shapelets + training features).
classifier: ClassifFitThe inner classifier fitted on the n×K shapelet-distance features.
config: ShapeletClassifierConfigThe configuration used to produce this fit.
classes: Vec<usize>Distinct original labels in sorted order; index = remapped class produced by the inner classifier, value = the caller’s original label. Used to map inner predictions back to the caller’s label space.
Implementations§
Source§impl ShapeletClassifierFit
impl ShapeletClassifierFit
Sourcepub fn shapelets(&self) -> &ShapeletSet
pub fn shapelets(&self) -> &ShapeletSet
The fitted shapelet set (already z-normalized, ordered by quality).
Sourcepub fn transform(&self) -> &ShapeletTransformFit
pub fn transform(&self) -> &ShapeletTransformFit
The fitted shapelet transform.
Sourcepub fn classifier(&self) -> &ClassifFit
pub fn classifier(&self) -> &ClassifFit
The inner classifier fitted on the shapelet-distance features.
Sourcepub fn train_accuracy(&self) -> f64
pub fn train_accuracy(&self) -> f64
Training-set accuracy of the inner classifier on the shapelet-distance features.
This is not a generalization estimate. The shapelets were selected to
separate the training classes; evaluate on a held-out split via
predict instead.
Sourcepub fn predict(&self, new_data: &FdMatrix) -> Result<Vec<usize>, FdarError>
pub fn predict(&self, new_data: &FdMatrix) -> Result<Vec<usize>, FdarError>
Predict class labels for out-of-sample curves.
Transforms new_data through the stored shapelets (identical sequences,
stored z-normalization) into an n_new×K distance-feature matrix, then
classifies each row with the stored inner ClassifFit by reusing the
FpcPredictor projection path (project features → FPC scores →
predict_from_scores). Predictions are mapped back to the caller’s original
label space.
§Errors
FdarError::InvalidDimension(propagated from the transform) if any series innew_datais shorter than a discovered shapelet.FdarError::InvalidParameterif the stored shapelet set is empty.
Trait Implementations§
Source§impl Clone for ShapeletClassifierFit
impl Clone for ShapeletClassifierFit
Source§fn clone(&self) -> ShapeletClassifierFit
fn clone(&self) -> ShapeletClassifierFit
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ShapeletClassifierFit
impl Debug for ShapeletClassifierFit
Source§impl PartialEq for ShapeletClassifierFit
impl PartialEq for ShapeletClassifierFit
impl StructuralPartialEq for ShapeletClassifierFit
Auto Trait Implementations§
impl Freeze for ShapeletClassifierFit
impl RefUnwindSafe for ShapeletClassifierFit
impl Send for ShapeletClassifierFit
impl Sync for ShapeletClassifierFit
impl Unpin for ShapeletClassifierFit
impl UnsafeUnpin for ShapeletClassifierFit
impl UnwindSafe for ShapeletClassifierFit
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.