pub struct DistributionFeaturesExtractor { /* private fields */ }Expand description
Distribution-Based Feature Extractor
Extracts features based on the empirical distribution of data including quantiles, percentiles, histogram features, and distribution shape measures.
§Parameters
n_quantiles- Number of quantiles to computen_bins- Number of histogram binsinclude_shape_features- Whether to include distribution shape featuresdensity_estimation- Method for density estimation (“histogram”, “kde”)
§Examples
use sklears_feature_extraction::statistical_features::DistributionFeaturesExtractor;
use scirs2_core::ndarray::array;
let data = array![1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0];
let extractor = DistributionFeaturesExtractor::new()
.n_quantiles(5)
.n_bins(10)
.include_shape_features(true);
let features = extractor.extract_features(&data.view()).expect("valid data produces features");Implementations§
Source§impl DistributionFeaturesExtractor
impl DistributionFeaturesExtractor
Sourcepub fn n_quantiles(self, n_quantiles: usize) -> Self
pub fn n_quantiles(self, n_quantiles: usize) -> Self
Set the number of quantiles
Sourcepub fn include_shape_features(self, include_shape_features: bool) -> Self
pub fn include_shape_features(self, include_shape_features: bool) -> Self
Set whether to include shape features
Sourcepub fn density_estimation(self, method: String) -> Self
pub fn density_estimation(self, method: String) -> Self
Set the density estimation method
Sourcepub fn extract_features(
&self,
data: &ArrayView1<'_, Float>,
) -> SklResult<Array1<Float>>
pub fn extract_features( &self, data: &ArrayView1<'_, Float>, ) -> SklResult<Array1<Float>>
Extract distribution-based features from data
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DistributionFeaturesExtractor
impl RefUnwindSafe for DistributionFeaturesExtractor
impl Send for DistributionFeaturesExtractor
impl Sync for DistributionFeaturesExtractor
impl Unpin for DistributionFeaturesExtractor
impl UnsafeUnpin for DistributionFeaturesExtractor
impl UnwindSafe for DistributionFeaturesExtractor
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