pub struct SlidingWindowFeatures { /* private fields */ }Expand description
Sliding Window Feature Extractor
Extracts features from sliding windows of time series data including various statistical measures, moving averages, and volatility metrics.
§Parameters
window_size- Size of the sliding windowstep_size- Step size for window slidingfeatures- List of features to extract (“mean”, “std”, “min”, “max”, “median”, “volatility”, “skewness”, “kurtosis”)
§Examples
use sklears_feature_extraction::temporal_features::SlidingWindowFeatures;
use scirs2_core::ndarray::{array, Array1, ArrayView1, ArrayView2};
let ts_data = array![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
let extractor = SlidingWindowFeatures::new()
.window_size(5)
.step_size(1)
.features(vec!["mean".to_string(), "std".to_string(), "volatility".to_string()]);
let features = extractor.extract_features(&ts_data.view()).expect("valid time series produces features");Implementations§
Source§impl SlidingWindowFeatures
impl SlidingWindowFeatures
Sourcepub fn window_size(self, window_size: usize) -> Self
pub fn window_size(self, window_size: usize) -> Self
Set the window size
Sourcepub fn extract_features(
&self,
ts: &ArrayView1<'_, Float>,
) -> SklResult<Array2<Float>>
pub fn extract_features( &self, ts: &ArrayView1<'_, Float>, ) -> SklResult<Array2<Float>>
Extract sliding window features from a time series
Trait Implementations§
Source§impl Clone for SlidingWindowFeatures
impl Clone for SlidingWindowFeatures
Source§impl Debug for SlidingWindowFeatures
impl Debug for SlidingWindowFeatures
Auto Trait Implementations§
impl Freeze for SlidingWindowFeatures
impl RefUnwindSafe for SlidingWindowFeatures
impl Send for SlidingWindowFeatures
impl Sync for SlidingWindowFeatures
impl Unpin for SlidingWindowFeatures
impl UnsafeUnpin for SlidingWindowFeatures
impl UnwindSafe for SlidingWindowFeatures
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
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> ⓘ
Converts
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> ⓘ
Converts
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 more