Module automated_feature_engineering

Module automated_feature_engineering 

Source
Expand description

Automated Feature Engineering

This module provides automated feature engineering capabilities that can automatically generate new features from existing ones to improve model performance.

§Features

  • Feature Generation: Automatically create polynomial, interaction, and transformation features
  • Feature Selection: Select the most relevant features using various scoring methods
  • Feature Transformation: Apply mathematical transformations to discover hidden patterns
  • Feature Importance: Rank features by their predictive power
  • Domain-Specific Engineering: Apply domain knowledge for specific feature types

§Examples

use sklears_preprocessing::automated_feature_engineering::{
    AutoFeatureEngineer, AutoFeatureConfig, GenerationStrategy
};
use scirs2_core::ndarray::Array2;

fn example() -> Result<(), Box<dyn std::error::Error>> {
    let config = AutoFeatureConfig::new()
        .with_strategy(GenerationStrategy::Polynomial { degree: 2 })
        .with_max_features(100)
        .with_selection_threshold(0.01);
     
    let mut engineer = AutoFeatureEngineer::new(config);
     
    let data = Array2::from_shape_vec((100, 5), (0..500).map(|x| x as f64).collect())?;
    let target = Array1::from_vec((0..100).map(|x| (x % 2) as f64).collect());
     
    let engineer_fitted = engineer.fit(&data, &target)?;
    let transformed = engineer_fitted.transform(&data)?;
     
    println!("Original features: {}", data.ncols());
    println!("Generated features: {}", transformed.ncols());
     
    Ok(())
}

Structs§

AutoFeatureConfig
Configuration for automated feature engineering
AutoFeatureEngineer
Automated feature engineering transformer
AutoFeatureEngineerFitted
Fitted automated feature engineer
TransformationFunction
Represents a transformation function for feature generation

Enums§

Domain
Domain-specific feature engineering
GenerationStrategy
Feature generation strategies
MathFunction
Mathematical functions for feature transformation
SelectionMethod
Feature selection methods
TransformationType
Types of transformations