pub struct FilterMethods;Expand description
Filter-based feature selection methods
Implementations§
Source§impl FilterMethods
impl FilterMethods
Sourcepub fn variance_threshold(
features: &Array2<f64>,
threshold: f64,
) -> Result<FeatureSelectionResult>
pub fn variance_threshold( features: &Array2<f64>, threshold: f64, ) -> Result<FeatureSelectionResult>
Variance-based feature selection
Removes features with low variance (quasi-constant features).
§Arguments
features- Feature matrix (samples x features)threshold- Minimum variance threshold
§Returns
- Feature selection result
§Example
use scirs2_core::ndarray::Array2;
use scirs2_series::feature_selection::FilterMethods;
let features = Array2::from_shape_vec((100, 5), (0..500).map(|x| x as f64).collect()).expect("Operation failed");
let result = FilterMethods::variance_threshold(&features, 0.1).expect("Operation failed");
println!("Selected {} features", result.selected_features.len());Sourcepub fn correlation_selection(
features: &Array2<f64>,
target: &Array1<f64>,
threshold: f64,
) -> Result<FeatureSelectionResult>
pub fn correlation_selection( features: &Array2<f64>, target: &Array1<f64>, threshold: f64, ) -> Result<FeatureSelectionResult>
Sourcepub fn mutual_information_selection(
features: &Array2<f64>,
target: &Array1<f64>,
n_bins: usize,
n_features: Option<usize>,
) -> Result<FeatureSelectionResult>
pub fn mutual_information_selection( features: &Array2<f64>, target: &Array1<f64>, n_bins: usize, n_features: Option<usize>, ) -> Result<FeatureSelectionResult>
Mutual information-based feature selection for time series
Estimates mutual information between features and target using histogram-based approach.
§Arguments
features- Feature matrix (samples x features)target- Target variablen_bins- Number of bins for histogram estimationn_features- Number of top features to select
§Returns
- Feature selection result
Sourcepub fn f_test_selection(
features: &Array2<f64>,
target: &Array1<f64>,
alpha: f64,
) -> Result<FeatureSelectionResult>
pub fn f_test_selection( features: &Array2<f64>, target: &Array1<f64>, alpha: f64, ) -> Result<FeatureSelectionResult>
Sourcepub fn autocorrelation_filter(
features: &Array2<f64>,
max_lag: usize,
threshold: f64,
) -> Result<FeatureSelectionResult>
pub fn autocorrelation_filter( features: &Array2<f64>, max_lag: usize, threshold: f64, ) -> Result<FeatureSelectionResult>
Auto Trait Implementations§
impl Freeze for FilterMethods
impl RefUnwindSafe for FilterMethods
impl Send for FilterMethods
impl Sync for FilterMethods
impl Unpin for FilterMethods
impl UnsafeUnpin for FilterMethods
impl UnwindSafe for FilterMethods
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
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 moreSource§impl<T> Pointable for T
impl<T> Pointable 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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.