quantrs2_device/ml_optimization/
ensemble.rs1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct EnsembleConfig {
8 pub enable_ensemble: bool,
10 pub ensemble_methods: Vec<EnsembleMethod>,
12 pub num_models: usize,
14 pub voting_strategy: VotingStrategy,
16 pub diversity_measures: Vec<DiversityMeasure>,
18 pub dynamic_selection: bool,
20}
21
22#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
24pub enum EnsembleMethod {
25 Bagging,
26 Boosting,
27 Stacking,
28 VotingClassifier,
29 RandomSubspace,
30 DynamicSelection,
31}
32
33#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub enum VotingStrategy {
36 Majority,
37 Weighted,
38 Stacking,
39 BayesianAveraging,
40 PerformanceBased,
41}
42
43#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
45pub enum DiversityMeasure {
46 PairwiseDisagreement,
47 EntropyMeasure,
48 CorrelationCoefficient,
49 QStatistic,
50 KappaDiversity,
51}