use scirs2_core::ndarray::Array1;
use std::collections::HashMap;
pub mod embedded;
pub mod filter;
pub mod selector;
pub mod time_series;
pub mod wrapper;
#[cfg(test)]
mod tests;
pub use embedded::EmbeddedMethods;
pub use filter::FilterMethods;
pub use selector::FeatureSelector;
pub use time_series::TimeSeriesMethods;
pub use wrapper::WrapperMethods;
#[derive(Debug, Clone)]
pub struct FeatureSelectionResult {
pub selected_features: Vec<usize>,
pub feature_scores: Array1<f64>,
pub method: String,
pub metadata: HashMap<String, f64>,
}
#[derive(Debug, Clone)]
pub struct FeatureSelectionConfig {
pub n_features: Option<usize>,
pub scoring_method: ScoringMethod,
pub cv_folds: usize,
pub alpha: f64,
pub correlation_threshold: f64,
pub variance_threshold: f64,
pub max_iterations: usize,
pub random_seed: Option<u64>,
pub regularization_alpha: f64,
pub max_lag: usize,
pub seasonal_period: Option<usize>,
}
impl Default for FeatureSelectionConfig {
fn default() -> Self {
Self {
n_features: None,
scoring_method: ScoringMethod::MeanSquaredError,
cv_folds: 5,
alpha: 0.05,
correlation_threshold: 0.1,
variance_threshold: 0.01,
max_iterations: 100,
random_seed: None,
regularization_alpha: 1.0,
max_lag: 10,
seasonal_period: None,
}
}
}
#[derive(Debug, Clone)]
pub enum ScoringMethod {
MeanSquaredError,
MeanAbsoluteError,
RSquared,
AIC,
BIC,
CrossValidation,
}