pub struct ConsensusFeatureSelector<State = Untrained> { /* private fields */ }Expand description
Consensus feature selection using multiple selectors and voting mechanisms Focuses on feature selection agreement rather than ranking aggregation
Implementations§
Source§impl ConsensusFeatureSelector<Untrained>
impl ConsensusFeatureSelector<Untrained>
Sourcepub fn add_selector(self, selector: Box<dyn SelectorFunction>) -> Self
pub fn add_selector(self, selector: Box<dyn SelectorFunction>) -> Self
Add a selector to the consensus
Sourcepub fn consensus_method(self, method: ConsensusMethod) -> Self
pub fn consensus_method(self, method: ConsensusMethod) -> Self
Set the consensus method
Sourcepub fn threshold_params(self, params: ConsensusThresholdParams) -> Self
pub fn threshold_params(self, params: ConsensusThresholdParams) -> Self
Set the threshold parameters
Sourcepub fn k_per_selector(self, k: usize) -> Self
pub fn k_per_selector(self, k: usize) -> Self
Set number of top features to select per selector
Sourcepub fn percentile_per_selector(
self,
percentile: f64,
) -> Result<Self, SklearsError>
pub fn percentile_per_selector( self, percentile: f64, ) -> Result<Self, SklearsError>
Set percentile of features to select per selector
Sourcepub fn add_common_selectors_classif(self) -> Self
pub fn add_common_selectors_classif(self) -> Self
Convenience method to add common selectors for classification
Sourcepub fn add_common_selectors_regression(self) -> Self
pub fn add_common_selectors_regression(self) -> Self
Convenience method to add common selectors for regression
Source§impl ConsensusFeatureSelector<Trained>
impl ConsensusFeatureSelector<Trained>
Sourcepub fn consensus_scores(&self) -> SklResult<&Array1<f64>>
pub fn consensus_scores(&self) -> SklResult<&Array1<f64>>
Get the consensus scores for all features
Sourcepub fn selected_features(&self) -> SklResult<&[usize]>
pub fn selected_features(&self) -> SklResult<&[usize]>
Get the final selected features
Sourcepub fn selector_decisions(&self) -> SklResult<&[Vec<bool>]>
pub fn selector_decisions(&self) -> SklResult<&[Vec<bool>]>
Get individual selector decisions
Sourcepub fn get_support_mask(&self) -> SklResult<Vec<bool>>
pub fn get_support_mask(&self) -> SklResult<Vec<bool>>
Get support mask for selected features
Sourcepub fn selector_agreement_matrix(&self) -> SklResult<Array2<f64>>
pub fn selector_agreement_matrix(&self) -> SklResult<Array2<f64>>
Get agreement matrix between selectors
Trait Implementations§
Source§impl<State: Clone> Clone for ConsensusFeatureSelector<State>
impl<State: Clone> Clone for ConsensusFeatureSelector<State>
Source§impl<State: Debug> Debug for ConsensusFeatureSelector<State>
impl<State: Debug> Debug for ConsensusFeatureSelector<State>
Source§impl Default for ConsensusFeatureSelector<Untrained>
impl Default for ConsensusFeatureSelector<Untrained>
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for ConsensusFeatureSelector<Untrained>
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<f64>, Dim<[usize; 1]>>> for ConsensusFeatureSelector<Untrained>
Source§type Fitted = ConsensusFeatureSelector<Trained>
type Fitted = ConsensusFeatureSelector<Trained>
The fitted model type
Source§fn fit(self, x: &Array2<f64>, y: &Array1<f64>) -> SklResult<Self::Fitted>
fn fit(self, x: &Array2<f64>, y: &Array1<f64>) -> SklResult<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Source§impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>> for ConsensusFeatureSelector<Untrained>
impl Fit<ArrayBase<OwnedRepr<f64>, Dim<[usize; 2]>>, ArrayBase<OwnedRepr<i32>, Dim<[usize; 1]>>> for ConsensusFeatureSelector<Untrained>
Source§type Fitted = ConsensusFeatureSelector<Trained>
type Fitted = ConsensusFeatureSelector<Trained>
The fitted model type
Source§fn fit(self, x: &Array2<f64>, y: &Array1<i32>) -> SklResult<Self::Fitted>
fn fit(self, x: &Array2<f64>, y: &Array1<i32>) -> SklResult<Self::Fitted>
Fit the model to the provided data with validation
Source§fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
fn fit_with_validation(
self,
x: &X,
y: &Y,
_x_val: Option<&X>,
_y_val: Option<&Y>,
) -> Result<(Self::Fitted, FitMetrics), SklearsError>where
Self: Sized,
Fit with custom validation and early stopping
Auto Trait Implementations§
impl<State = Untrained> !RefUnwindSafe for ConsensusFeatureSelector<State>
impl<State = Untrained> !UnwindSafe for ConsensusFeatureSelector<State>
impl<State> Freeze for ConsensusFeatureSelector<State>where
PhantomData<State>: Freeze,
impl<State> Send for ConsensusFeatureSelector<State>where
PhantomData<State>: Send,
impl<State> Sync for ConsensusFeatureSelector<State>where
PhantomData<State>: Sync,
impl<State> Unpin for ConsensusFeatureSelector<State>where
PhantomData<State>: Unpin,
impl<State> UnsafeUnpin for ConsensusFeatureSelector<State>where
PhantomData<State>: UnsafeUnpin,
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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.