nvflare.app_opt.feature_election.feature_election module
Feature Election Library for NVIDIA FLARE High-level API for federated feature selection and training workflow.
- class FeatureElection(freedom_degree: float = 0.5, fs_method: str = 'lasso', aggregation_mode: str = 'weighted', auto_tune: bool = False, tuning_rounds: int = 5, eval_metric: str = 'f1', wait_time_after_min_received: int = 10, fs_params: Dict | None = None)[source]
Bases:
objectHigh-level interface for Feature Election in NVIDIA FLARE. Simplifies integration with tabular datasets for federated feature selection.
This class provides: - Easy data preparation and splitting - Local simulation for testing - Result management and persistence
- apply_mask(X: DataFrame | ndarray) DataFrame | ndarray[source]
Apply global feature mask to new data.
- create_flare_job(job_name: str = 'feature_election', output_dir: str = 'jobs/feature_election', min_clients: int = 2, num_rounds: int = 5, client_sites: List[str] | None = None) Dict[str, str][source]
Generate FLARE job configuration.
- quick_election(df: DataFrame, target_col: str, num_clients: int = 3, freedom_degree: float = 0.5, fs_method: str = 'lasso', split_strategy: str = 'stratified', **kwargs) Tuple[ndarray, Dict][source]
Quick Feature Election for tabular data (one-line solution).
**kwargsare routed to eitherFeatureElectionorFeatureElection.prepare_data_splits()based on the parameter name. Recognised split parameters:split_ratios,random_state,dirichlet_alpha. All other kwargs are forwarded toFeatureElection(e.g.aggregation_mode,auto_tune,fs_params).