pub struct TemporalFeatureExtractor { /* private fields */ }Expand description
Temporal Feature Extractor
Extracts temporal features from time series data including lag features, rolling statistics, trend, and seasonality components.
§Parameters
n_lags- Number of lag features to generatewindow_sizes- Window sizes for rolling statisticsextract_trend- Whether to extract trend featuresextract_seasonality- Whether to extract seasonality featuresseasonal_periods- Periods for seasonality extraction
§Examples
use sklears_feature_extraction::temporal_features::TemporalFeatureExtractor;
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];
let extractor = TemporalFeatureExtractor::new()
.n_lags(3)
.window_sizes(vec![3, 5])
.extract_trend(true);
let features = extractor.extract_features(&ts_data.view()).expect("valid time series produces features");Implementations§
Source§impl TemporalFeatureExtractor
impl TemporalFeatureExtractor
Sourcepub fn window_sizes(self, window_sizes: Vec<usize>) -> Self
pub fn window_sizes(self, window_sizes: Vec<usize>) -> Self
Set the window sizes for rolling statistics
Sourcepub fn extract_trend(self, extract_trend: bool) -> Self
pub fn extract_trend(self, extract_trend: bool) -> Self
Set whether to extract trend features
Sourcepub fn extract_seasonality(self, extract_seasonality: bool) -> Self
pub fn extract_seasonality(self, extract_seasonality: bool) -> Self
Set whether to extract seasonality features
Sourcepub fn seasonal_periods(self, seasonal_periods: Vec<usize>) -> Self
pub fn seasonal_periods(self, seasonal_periods: Vec<usize>) -> Self
Set the seasonal periods
Sourcepub fn fill_method(self, fill_method: String) -> Self
pub fn fill_method(self, fill_method: String) -> Self
Set the fill method for missing values
Sourcepub fn extract_features(
&self,
ts: &ArrayView1<'_, Float>,
) -> SklResult<Array1<Float>>
pub fn extract_features( &self, ts: &ArrayView1<'_, Float>, ) -> SklResult<Array1<Float>>
Extract temporal features from a time series
Trait Implementations§
Source§impl Clone for TemporalFeatureExtractor
impl Clone for TemporalFeatureExtractor
Source§impl Debug for TemporalFeatureExtractor
impl Debug for TemporalFeatureExtractor
Auto Trait Implementations§
impl Freeze for TemporalFeatureExtractor
impl RefUnwindSafe for TemporalFeatureExtractor
impl Send for TemporalFeatureExtractor
impl Sync for TemporalFeatureExtractor
impl Unpin for TemporalFeatureExtractor
impl UnsafeUnpin for TemporalFeatureExtractor
impl UnwindSafe for TemporalFeatureExtractor
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