-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.yaml
More file actions
169 lines (146 loc) · 3.95 KB
/
Copy pathconfig.yaml
File metadata and controls
169 lines (146 loc) · 3.95 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# Configuration for Oxford Nanopore Polishing Decision Tool
# ==========================================================
# Data paths
data:
input_csv: "data/all_samples_polishing_metrics.csv"
merged_csv: "data/all_samples_polishing_metrics.csv"
labeled_csv: "data/training_dataset_with_target.csv"
engineered_csv: "data/training_dataset_engineered.csv"
# Class Configuration (CRITICAL IMPROVEMENT: 3-class system)
classes:
n_classes: 3
class_mapping:
1: "Early (R1-R2)" # Stop early: rounds 1-2
2: "Medium (R3-R4)" # Stop mid-way: rounds 3-4
3: "Late (R5)" # Continue to end: round 5
# Original to new class mapping
original_to_new:
1: 1 # Early
2: 1 # Early
3: 2 # Medium
4: 2 # Medium
5: 3 # Late
# R1 Quality Thresholds (for early stopping consideration)
r1_thresholds:
min_busco: 95.0 # Minimum BUSCO complete %
max_assembly_error: 0.02 # Maximum |assembly_frac - 1.0|
max_error_rate: 0.07 # Maximum error rate
max_contigs: null # Maximum contigs (null = ignore)
min_coverage_est: 8.0 # Minimum coverage estimate
max_align_err_cons: 0.15 # Maximum alignment error in consensus
# Stability Thresholds (for R1 stability check)
stability:
eps_qv: 0.05 # QV tolerance
eps_error: 0.0005 # Error rate tolerance
eps_busco: 1.0 # BUSCO tolerance
eps_assembly_frac: 0.01 # Assembly fraction tolerance
use_assembly_frac: false # Whether to include assembly_frac in stability
# Plateau Detection
plateau:
relative_threshold: 0.12 # 12% of max improvement
# Feature Engineering
features:
# Base features from data
base:
- n50
- qv
- error_rate
- busco_complete
- busco_fragmented
- busco_missing
- assembly_frac
- assembly_error
- num_contigs
- total_length
# Ratio features (NEW)
ratios:
- qv_per_round
- busco_per_round
- improvement_rate
- cost_benefit_ratio
# Trend features (NEW)
trends:
- delta_qv
- delta_busco
- delta_error
- delta_assembly
- score_improvement
# Cumulative features
cumulative:
- gain_cum
- plateau_streak
# Normalized to R1 (NEW)
normalized_r1:
- qv_from_r1
- busco_complete_from_r1
- error_rate_from_r1
- assembly_frac_from_r1
# Model Training Configuration
models:
random_state: 42
test_size: 0.20
cv_folds: 5
# XGBoost Configuration
xgboost:
n_estimators: 500
max_depth: 6
learning_rate: 0.05
subsample: 0.8
colsample_bytree: 0.8
min_child_weight: 3
gamma: 0.1
reg_alpha: 0.1
reg_lambda: 1.0
# Random Forest Configuration
random_forest:
n_estimators: 800
max_depth: 12
min_samples_leaf: 2
max_features: "sqrt"
# Ordinal Regression Configuration
ordinal_regression:
alpha: 1.0
# Imbalance Handling
imbalance:
use_smote: true
smote_k_neighbors: 3
smote_sampling_strategy: "auto"
# Class weights
class_weights:
1: 2.0 # Early - boost minority
2: 1.5 # Medium
3: 1.0 # Late - most common
# Evaluation Metrics
evaluation:
primary_metric: "balanced_accuracy"
target_metrics:
balanced_accuracy: 0.65
macro_f1: 0.60
min_class_recall: 0.40
mae: 0.5
qwk: 0.50
# Hierarchical Policy (3-class version)
hierarchical:
stage_a:
# Binary: Early (1) vs Continue (2-3)
threshold: 0.5
model: "logistic_regression"
stage_b:
# Binary: Medium (2) vs Late (3)
model: "random_forest"
# Post-processing Rules
postprocessing:
conservative_bias: true # Prefer one extra round over stopping too early
smooth_predictions: true # Avoid large jumps in predictions
use_domain_rules: true # Apply r1_ok and stability rules
# Output Configuration
outputs:
models_dir: "models/"
results_dir: "outputs/"
plots_dir: "outputs/plots/"
logs_dir: "logs/"
# Logging
logging:
level: "INFO"
format: "%(asctime)s - %(name)s - %(levelname)s - %(message)s"
file: "logs/pipeline.log"