1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
//! Boosting mode selection for UniversalModel
use crateAnalysisConfig;
use ;
// =============================================================================
// BoostingMode
// =============================================================================
/// Boosting mode for UniversalModel
// =============================================================================
// ModeSelection - How to choose the boosting mode
// =============================================================================
/// How to select the boosting mode
///
/// TreeBoost provides three ways to select the boosting mode:
///
/// 1. **Auto** (recommended): Let TreeBoost analyze the data and pick the best mode
/// 2. **AutoWithConfig**: Auto with custom analysis configuration
/// 3. **Fixed**: You explicitly specify the mode
///
/// # Example: Auto Selection
///
/// ```ignore
/// use treeboost::{UniversalModel, UniversalConfig, ModeSelection, MseLoss};
///
/// let config = UniversalConfig::new()
/// .with_mode_selection(ModeSelection::Auto)
/// .with_num_rounds(100);
///
/// let model = UniversalModel::train_smart(&dataset, config, &MseLoss)?;
/// println!("Selected mode: {:?}", model.mode());
/// println!("Confidence: {:?}", model.selection_confidence());
/// ```
///
/// # Example: Fixed Mode
///
/// ```ignore
/// use treeboost::{UniversalModel, UniversalConfig, ModeSelection, BoostingMode};
///
/// let config = UniversalConfig::new()
/// .with_mode_selection(ModeSelection::Fixed(BoostingMode::LinearThenTree))
/// .with_num_rounds(100);
/// ```