pub struct ParallelFeatureExtractor { /* private fields */ }Expand description
Parallel Feature Extractor for High-Performance Computing
This extractor provides parallel computation of various feature types across data chunks, optimized for large datasets and multi-core systems.
Features extracted include:
- Statistical features computed in parallel across columns and rows
- Distance matrix features with parallel distance computation
- Correlation features with parallel correlation computation
- Configurable chunk size and thread count for optimal performance
§Parameters
chunk_size- Size of data chunks for parallel processingnum_threads- Number of threads to use (None for automatic)include_distance_matrix- Whether to compute distance matrix featuresinclude_statistical_features- Whether to compute statistical featuresinclude_correlation_features- Whether to compute correlation featuresdistance_metric- Distance metric for distance matrix computation
§Examples
let data = Array2::from_shape_vec((1000, 50), (0..50000).map(|x| x as f64).collect())?;
let extractor = ParallelFeatureExtractor::new()
.chunk_size(100)
.num_threads(4)
.include_statistical_features(true)
.include_distance_matrix(true);
let features = extractor.extract_features(&data.view())?;
assert!(features.len() > 0);Implementations§
Source§impl ParallelFeatureExtractor
impl ParallelFeatureExtractor
Sourcepub fn chunk_size(self, size: usize) -> Self
pub fn chunk_size(self, size: usize) -> Self
Set the chunk size for parallel processing
Sourcepub fn num_threads(self, threads: usize) -> Self
pub fn num_threads(self, threads: usize) -> Self
Set the number of threads to use
Sourcepub fn include_distance_matrix(self, include: bool) -> Self
pub fn include_distance_matrix(self, include: bool) -> Self
Set whether to compute distance matrix features
Sourcepub fn include_statistical_features(self, include: bool) -> Self
pub fn include_statistical_features(self, include: bool) -> Self
Set whether to compute statistical features
Sourcepub fn include_correlation_features(self, include: bool) -> Self
pub fn include_correlation_features(self, include: bool) -> Self
Set whether to compute correlation features
Sourcepub fn distance_metric(self, metric: &str) -> Self
pub fn distance_metric(self, metric: &str) -> Self
Set the distance metric for distance matrix computation
Sourcepub fn extract_features(
&self,
data: &ArrayView2<'_, Float>,
) -> SklResult<Array1<Float>>
pub fn extract_features( &self, data: &ArrayView2<'_, Float>, ) -> SklResult<Array1<Float>>
Extract features using parallel processing
Trait Implementations§
Source§impl Clone for ParallelFeatureExtractor
impl Clone for ParallelFeatureExtractor
Source§impl Debug for ParallelFeatureExtractor
impl Debug for ParallelFeatureExtractor
Auto Trait Implementations§
impl Freeze for ParallelFeatureExtractor
impl RefUnwindSafe for ParallelFeatureExtractor
impl Send for ParallelFeatureExtractor
impl Sync for ParallelFeatureExtractor
impl Unpin for ParallelFeatureExtractor
impl UnsafeUnpin for ParallelFeatureExtractor
impl UnwindSafe for ParallelFeatureExtractor
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