dragon-ml-toolbox 19.6.0__tar.gz → 19.8.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dragon_ml_toolbox-19.6.0/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-19.8.0}/PKG-INFO +1 -1
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0/dragon_ml_toolbox.egg-info}/PKG-INFO +1 -1
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_configuration.py +4 -2
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_configuration.py +200 -41
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_evaluation.py +177 -63
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_evaluation_multi.py +89 -32
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_optimization_pareto.py +118 -64
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_sequence_evaluation.py +1 -1
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_vision_evaluation.py +1 -1
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_keys.py +18 -4
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/pyproject.toml +1 -1
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/LICENSE +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/LICENSE-THIRD-PARTY.md +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/README.md +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ETL_cleaning.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ETL_engineering.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/GUI_tools.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/IO_tools.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/MICE_imputation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_callbacks.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_chaining_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_chaining_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_configuration_pytab.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_evaluation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_evaluation_captum.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_evaluation_multi.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_finalize_handler.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_models.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_models_advanced.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_models_pytab.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_optimization.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_optimization_pareto.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_scaler.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_sequence_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_sequence_evaluation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_sequence_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_sequence_models.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_trainer.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_vision_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_vision_evaluation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_vision_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_vision_models.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ML_vision_transformers.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/PSO_optimization.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/SQL.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/VIF_factor.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/__init__.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ETL_cleaning.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ETL_engineering.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_GUI_tools.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_IO_tools.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_MICE_imputation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_callbacks.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_chaining_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_chaining_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_configuration_pytab.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_evaluation_captum.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_finalize_handler.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_models.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_models_advanced.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_models_pytab.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_optimization.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_scaler.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_sequence_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_sequence_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_sequence_models.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_trainer.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_vision_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_vision_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_vision_models.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ML_vision_transformers.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_PSO_optimization.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_SQL.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_VIF_factor.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/__init__.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_data_exploration.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ensemble_evaluation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ensemble_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_ensemble_learning.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_excel_handler.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_logger.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_math_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_models_advanced_base.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_models_advanced_helpers.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_optimization_tools.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_path_manager.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_plot_fonts.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_schema.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_script_info.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_serde.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/_core/_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/constants.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/data_exploration.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ensemble_evaluation.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ensemble_inference.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/ensemble_learning.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/excel_handler.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/math_utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/optimization_tools.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/path_manager.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/plot_fonts.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/schema.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/serde.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/ml_tools/utilities.py +0 -0
- {dragon_ml_toolbox-19.6.0 → dragon_ml_toolbox-19.8.0}/setup.cfg +0 -0
|
@@ -37,7 +37,8 @@ from ._core._ML_configuration import (
|
|
|
37
37
|
DragonAutoIntParams,
|
|
38
38
|
|
|
39
39
|
# --- Training Config ---
|
|
40
|
-
DragonTrainingConfig,
|
|
40
|
+
DragonTrainingConfig,
|
|
41
|
+
DragonParetoConfig,
|
|
41
42
|
info
|
|
42
43
|
)
|
|
43
44
|
|
|
@@ -80,5 +81,6 @@ __all__ = [
|
|
|
80
81
|
"DragonAutoIntParams",
|
|
81
82
|
|
|
82
83
|
# --- Training Config ---
|
|
83
|
-
"DragonTrainingConfig"
|
|
84
|
+
"DragonTrainingConfig",
|
|
85
|
+
"DragonParetoConfig",
|
|
84
86
|
]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
from typing import Union, Optional, List, Any, Dict, Literal
|
|
1
|
+
from typing import Union, Optional, List, Any, Dict, Literal, Tuple
|
|
2
|
+
from pathlib import Path
|
|
2
3
|
from collections.abc import Mapping
|
|
3
4
|
import numpy as np
|
|
4
5
|
|
|
@@ -51,7 +52,8 @@ __all__ = [
|
|
|
51
52
|
"DragonAutoIntParams",
|
|
52
53
|
|
|
53
54
|
# --- Training Config ---
|
|
54
|
-
"DragonTrainingConfig"
|
|
55
|
+
"DragonTrainingConfig",
|
|
56
|
+
"DragonParetoConfig"
|
|
55
57
|
]
|
|
56
58
|
|
|
57
59
|
|
|
@@ -65,7 +67,11 @@ class _BaseClassificationFormat:
|
|
|
65
67
|
cmap: str="BuGn",
|
|
66
68
|
ROC_PR_line: str='darkorange',
|
|
67
69
|
calibration_bins: int=15,
|
|
68
|
-
|
|
70
|
+
xtick_size: int=22,
|
|
71
|
+
ytick_size: int=22,
|
|
72
|
+
legend_size: int=26,
|
|
73
|
+
font_size: int=26,
|
|
74
|
+
cm_font_size: int=26) -> None:
|
|
69
75
|
"""
|
|
70
76
|
Initializes the formatting configuration for single-label classification metrics.
|
|
71
77
|
|
|
@@ -84,6 +90,14 @@ class _BaseClassificationFormat:
|
|
|
84
90
|
creating the calibration (reliability) plot.
|
|
85
91
|
|
|
86
92
|
font_size (int): The base font size to apply to the plots.
|
|
93
|
+
|
|
94
|
+
xtick_size (int): Font size for x-axis tick labels.
|
|
95
|
+
|
|
96
|
+
ytick_size (int): Font size for y-axis tick labels.
|
|
97
|
+
|
|
98
|
+
legend_size (int): Font size for plot legends.
|
|
99
|
+
|
|
100
|
+
cm_font_size (int): Font size for the confusion matrix.
|
|
87
101
|
|
|
88
102
|
<br>
|
|
89
103
|
|
|
@@ -97,13 +111,21 @@ class _BaseClassificationFormat:
|
|
|
97
111
|
self.ROC_PR_line = ROC_PR_line
|
|
98
112
|
self.calibration_bins = calibration_bins
|
|
99
113
|
self.font_size = font_size
|
|
114
|
+
self.xtick_size = xtick_size
|
|
115
|
+
self.ytick_size = ytick_size
|
|
116
|
+
self.legend_size = legend_size
|
|
117
|
+
self.cm_font_size = cm_font_size
|
|
100
118
|
|
|
101
119
|
def __repr__(self) -> str:
|
|
102
120
|
parts = [
|
|
103
121
|
f"cmap='{self.cmap}'",
|
|
104
122
|
f"ROC_PR_line='{self.ROC_PR_line}'",
|
|
105
123
|
f"calibration_bins={self.calibration_bins}",
|
|
106
|
-
f"font_size={self.font_size}"
|
|
124
|
+
f"font_size={self.font_size}",
|
|
125
|
+
f"xtick_size={self.xtick_size}",
|
|
126
|
+
f"ytick_size={self.ytick_size}",
|
|
127
|
+
f"legend_size={self.legend_size}",
|
|
128
|
+
f"cm_font_size={self.cm_font_size}"
|
|
107
129
|
]
|
|
108
130
|
return f"{self.__class__.__name__}({', '.join(parts)})"
|
|
109
131
|
|
|
@@ -115,7 +137,10 @@ class _BaseMultiLabelFormat:
|
|
|
115
137
|
def __init__(self,
|
|
116
138
|
cmap: str = "BuGn",
|
|
117
139
|
ROC_PR_line: str='darkorange',
|
|
118
|
-
font_size: int =
|
|
140
|
+
font_size: int = 25,
|
|
141
|
+
xtick_size: int=20,
|
|
142
|
+
ytick_size: int=20,
|
|
143
|
+
legend_size: int=23) -> None:
|
|
119
144
|
"""
|
|
120
145
|
Initializes the formatting configuration for multi-label classification metrics.
|
|
121
146
|
|
|
@@ -132,6 +157,12 @@ class _BaseMultiLabelFormat:
|
|
|
132
157
|
|
|
133
158
|
font_size (int): The base font size to apply to the plots.
|
|
134
159
|
|
|
160
|
+
xtick_size (int): Font size for x-axis tick labels.
|
|
161
|
+
|
|
162
|
+
ytick_size (int): Font size for y-axis tick labels.
|
|
163
|
+
|
|
164
|
+
legend_size (int): Font size for plot legends.
|
|
165
|
+
|
|
135
166
|
<br>
|
|
136
167
|
|
|
137
168
|
### [Matplotlib Colormaps](https://matplotlib.org/stable/users/explain/colors/colormaps.html)
|
|
@@ -143,12 +174,18 @@ class _BaseMultiLabelFormat:
|
|
|
143
174
|
self.cmap = cmap
|
|
144
175
|
self.ROC_PR_line = ROC_PR_line
|
|
145
176
|
self.font_size = font_size
|
|
177
|
+
self.xtick_size = xtick_size
|
|
178
|
+
self.ytick_size = ytick_size
|
|
179
|
+
self.legend_size = legend_size
|
|
146
180
|
|
|
147
181
|
def __repr__(self) -> str:
|
|
148
182
|
parts = [
|
|
149
183
|
f"cmap='{self.cmap}'",
|
|
150
184
|
f"ROC_PR_line='{self.ROC_PR_line}'",
|
|
151
|
-
f"font_size={self.font_size}"
|
|
185
|
+
f"font_size={self.font_size}",
|
|
186
|
+
f"xtick_size={self.xtick_size}",
|
|
187
|
+
f"ytick_size={self.ytick_size}",
|
|
188
|
+
f"legend_size={self.legend_size}"
|
|
152
189
|
]
|
|
153
190
|
return f"{self.__class__.__name__}({', '.join(parts)})"
|
|
154
191
|
|
|
@@ -158,12 +195,14 @@ class _BaseRegressionFormat:
|
|
|
158
195
|
[PRIVATE] Base configuration for regression metrics.
|
|
159
196
|
"""
|
|
160
197
|
def __init__(self,
|
|
161
|
-
font_size: int=
|
|
198
|
+
font_size: int=26,
|
|
162
199
|
scatter_color: str='tab:blue',
|
|
163
200
|
scatter_alpha: float=0.6,
|
|
164
201
|
ideal_line_color: str='k',
|
|
165
202
|
residual_line_color: str='red',
|
|
166
|
-
hist_bins: Union[int, str] = 'auto'
|
|
203
|
+
hist_bins: Union[int, str] = 'auto',
|
|
204
|
+
xtick_size: int=22,
|
|
205
|
+
ytick_size: int=22) -> None:
|
|
167
206
|
"""
|
|
168
207
|
Initializes the formatting configuration for regression metrics.
|
|
169
208
|
|
|
@@ -181,6 +220,8 @@ class _BaseRegressionFormat:
|
|
|
181
220
|
hist_bins (int | str): The number of bins for the residuals histogram.
|
|
182
221
|
Defaults to 'auto' to use seaborn's automatic bin selection.
|
|
183
222
|
- Options: 'auto', 'sqrt', 10, 20
|
|
223
|
+
xtick_size (int): Font size for x-axis tick labels.
|
|
224
|
+
ytick_size (int): Font size for y-axis tick labels.
|
|
184
225
|
|
|
185
226
|
<br>
|
|
186
227
|
|
|
@@ -192,6 +233,8 @@ class _BaseRegressionFormat:
|
|
|
192
233
|
self.ideal_line_color = ideal_line_color
|
|
193
234
|
self.residual_line_color = residual_line_color
|
|
194
235
|
self.hist_bins = hist_bins
|
|
236
|
+
self.xtick_size = xtick_size
|
|
237
|
+
self.ytick_size = ytick_size
|
|
195
238
|
|
|
196
239
|
def __repr__(self) -> str:
|
|
197
240
|
parts = [
|
|
@@ -200,7 +243,9 @@ class _BaseRegressionFormat:
|
|
|
200
243
|
f"scatter_alpha={self.scatter_alpha}",
|
|
201
244
|
f"ideal_line_color='{self.ideal_line_color}'",
|
|
202
245
|
f"residual_line_color='{self.residual_line_color}'",
|
|
203
|
-
f"hist_bins='{self.hist_bins}'"
|
|
246
|
+
f"hist_bins='{self.hist_bins}'",
|
|
247
|
+
f"xtick_size={self.xtick_size}",
|
|
248
|
+
f"ytick_size={self.ytick_size}"
|
|
204
249
|
]
|
|
205
250
|
return f"{self.__class__.__name__}({', '.join(parts)})"
|
|
206
251
|
|
|
@@ -248,7 +293,7 @@ class _BaseSequenceValueFormat:
|
|
|
248
293
|
[PRIVATE] Base configuration for sequence to value metrics.
|
|
249
294
|
"""
|
|
250
295
|
def __init__(self,
|
|
251
|
-
font_size: int=
|
|
296
|
+
font_size: int=25,
|
|
252
297
|
scatter_color: str='tab:blue',
|
|
253
298
|
scatter_alpha: float=0.6,
|
|
254
299
|
ideal_line_color: str='k',
|
|
@@ -300,8 +345,7 @@ class _BaseSequenceSequenceFormat:
|
|
|
300
345
|
[PRIVATE] Base configuration for sequence-to-sequence metrics.
|
|
301
346
|
"""
|
|
302
347
|
def __init__(self,
|
|
303
|
-
font_size: int =
|
|
304
|
-
plot_figsize: tuple[int, int] = (10, 6),
|
|
348
|
+
font_size: int = 25,
|
|
305
349
|
grid_style: str = '--',
|
|
306
350
|
rmse_color: str = 'tab:blue',
|
|
307
351
|
rmse_marker: str = 'o-',
|
|
@@ -312,7 +356,6 @@ class _BaseSequenceSequenceFormat:
|
|
|
312
356
|
|
|
313
357
|
Args:
|
|
314
358
|
font_size (int): The base font size to apply to the plots.
|
|
315
|
-
plot_figsize (Tuple[int, int]): Figure size for the plot.
|
|
316
359
|
grid_style (str): Matplotlib linestyle for the plot grid.
|
|
317
360
|
- Options: '--' (dashed), ':' (dotted), '-.' (dash-dot), '-' (solid)
|
|
318
361
|
rmse_color (str): Matplotlib color for the RMSE line.
|
|
@@ -337,7 +380,6 @@ class _BaseSequenceSequenceFormat:
|
|
|
337
380
|
### [Matplotlib Markers](https://matplotlib.org/stable/api/markers_api.html)
|
|
338
381
|
"""
|
|
339
382
|
self.font_size = font_size
|
|
340
|
-
self.plot_figsize = plot_figsize
|
|
341
383
|
self.grid_style = grid_style
|
|
342
384
|
self.rmse_color = rmse_color
|
|
343
385
|
self.rmse_marker = rmse_marker
|
|
@@ -347,7 +389,6 @@ class _BaseSequenceSequenceFormat:
|
|
|
347
389
|
def __repr__(self) -> str:
|
|
348
390
|
parts = [
|
|
349
391
|
f"font_size={self.font_size}",
|
|
350
|
-
f"plot_figsize={self.plot_figsize}",
|
|
351
392
|
f"grid_style='{self.grid_style}'",
|
|
352
393
|
f"rmse_color='{self.rmse_color}'",
|
|
353
394
|
f"mae_color='{self.mae_color}'"
|
|
@@ -406,6 +447,9 @@ class _BaseModelParams(Mapping):
|
|
|
406
447
|
if isinstance(v, FeatureSchema):
|
|
407
448
|
# Force the repr() string, otherwise json.dump treats it as a list
|
|
408
449
|
clean_dict[k] = repr(v)
|
|
450
|
+
elif isinstance(v, Path):
|
|
451
|
+
# JSON cannot serialize Path objects, convert to string
|
|
452
|
+
clean_dict[k] = str(v)
|
|
409
453
|
else:
|
|
410
454
|
clean_dict[k] = v
|
|
411
455
|
return clean_dict
|
|
@@ -607,6 +651,8 @@ class DragonTrainingConfig(_BaseModelParams):
|
|
|
607
651
|
Configuration object for the training process.
|
|
608
652
|
|
|
609
653
|
Can be unpacked as a dictionary for logging or accessed as an object.
|
|
654
|
+
|
|
655
|
+
Accepts arbitrary keyword arguments which are set as instance attributes.
|
|
610
656
|
"""
|
|
611
657
|
def __init__(self,
|
|
612
658
|
validation_size: float,
|
|
@@ -617,7 +663,7 @@ class DragonTrainingConfig(_BaseModelParams):
|
|
|
617
663
|
early_stop_patience: Optional[int] = None,
|
|
618
664
|
scheduler_patience: Optional[int] = None,
|
|
619
665
|
scheduler_lr_factor: Optional[float] = None,
|
|
620
|
-
|
|
666
|
+
**kwargs: Any) -> None:
|
|
621
667
|
self.validation_size = validation_size
|
|
622
668
|
self.test_size = test_size
|
|
623
669
|
self.initial_learning_rate = initial_learning_rate
|
|
@@ -626,7 +672,75 @@ class DragonTrainingConfig(_BaseModelParams):
|
|
|
626
672
|
self.early_stop_patience = early_stop_patience
|
|
627
673
|
self.scheduler_patience = scheduler_patience
|
|
628
674
|
self.scheduler_lr_factor = scheduler_lr_factor
|
|
629
|
-
|
|
675
|
+
|
|
676
|
+
# Process kwargs with validation
|
|
677
|
+
for key, value in kwargs.items():
|
|
678
|
+
# Python guarantees 'key' is a string for **kwargs
|
|
679
|
+
|
|
680
|
+
# Allow None in value
|
|
681
|
+
if value is None:
|
|
682
|
+
setattr(self, key, value)
|
|
683
|
+
continue
|
|
684
|
+
|
|
685
|
+
if isinstance(value, dict):
|
|
686
|
+
_LOGGER.error("Nested dictionaries are not supported, unpack them first.")
|
|
687
|
+
raise TypeError()
|
|
688
|
+
|
|
689
|
+
# Check if value is a number or a string or a JSON supported type, except dict
|
|
690
|
+
if not isinstance(value, (str, int, float, bool, list, tuple)):
|
|
691
|
+
_LOGGER.error(f"Invalid type for configuration '{key}': {type(value).__name__}")
|
|
692
|
+
raise TypeError()
|
|
693
|
+
|
|
694
|
+
setattr(self, key, value)
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
class DragonParetoConfig(_BaseModelParams):
|
|
698
|
+
"""
|
|
699
|
+
Configuration object for the Pareto Optimization process.
|
|
700
|
+
"""
|
|
701
|
+
def __init__(self,
|
|
702
|
+
save_directory: Union[str, Path],
|
|
703
|
+
target_objectives: Dict[str, Literal["min", "max"]],
|
|
704
|
+
continuous_bounds_map: Union[Dict[str, Tuple[float, float]], Dict[str, List[float]]],
|
|
705
|
+
columns_to_round: Optional[List[str]] = None,
|
|
706
|
+
population_size: int = 400,
|
|
707
|
+
generations: int = 1000,
|
|
708
|
+
solutions_filename: str = "ParetoSolutions",
|
|
709
|
+
float_precision: int = 4,
|
|
710
|
+
log_interval: int = 10,
|
|
711
|
+
plot_size: Tuple[int, int] = (10, 7),
|
|
712
|
+
plot_font_size: int = 16,
|
|
713
|
+
discretize_start_at_zero: bool = True):
|
|
714
|
+
"""
|
|
715
|
+
Configure the Pareto Optimizer.
|
|
716
|
+
|
|
717
|
+
Args:
|
|
718
|
+
save_directory (str | Path): Directory to save artifacts.
|
|
719
|
+
target_objectives (Dict[str, "min"|"max"]): Dictionary mapping target names to optimization direction.
|
|
720
|
+
Example: {"price": "max", "error": "min"}
|
|
721
|
+
continuous_bounds_map (Dict): Bounds for continuous features {name: (min, max)}.
|
|
722
|
+
columns_to_round (List[str] | None): List of continuous column names that should be rounded to the nearest integer.
|
|
723
|
+
population_size (int): Size of the genetic population.
|
|
724
|
+
generations (int): Number of generations to run.
|
|
725
|
+
solutions_filename (str): Filename for saving Pareto solutions.
|
|
726
|
+
float_precision (int): Number of decimal places to round standard float columns.
|
|
727
|
+
log_interval (int): Interval for logging progress.
|
|
728
|
+
plot_size (Tuple[int, int]): Size of the 2D plots.
|
|
729
|
+
plot_font_size (int): Font size for plot text.
|
|
730
|
+
discretize_start_at_zero (bool): Categorical encoding start index. True=0, False=1.
|
|
731
|
+
"""
|
|
732
|
+
self.save_directory = save_directory
|
|
733
|
+
self.target_objectives = target_objectives
|
|
734
|
+
self.continuous_bounds_map = continuous_bounds_map
|
|
735
|
+
self.columns_to_round = columns_to_round
|
|
736
|
+
self.population_size = population_size
|
|
737
|
+
self.generations = generations
|
|
738
|
+
self.solutions_filename = solutions_filename
|
|
739
|
+
self.float_precision = float_precision
|
|
740
|
+
self.log_interval = log_interval
|
|
741
|
+
self.plot_size = plot_size
|
|
742
|
+
self.plot_font_size = plot_font_size
|
|
743
|
+
self.discretize_start_at_zero = discretize_start_at_zero
|
|
630
744
|
|
|
631
745
|
|
|
632
746
|
# ----------------------------
|
|
@@ -639,18 +753,22 @@ class RegressionMetricsFormat(_BaseRegressionFormat):
|
|
|
639
753
|
Configuration for single-target regression.
|
|
640
754
|
"""
|
|
641
755
|
def __init__(self,
|
|
642
|
-
font_size: int=
|
|
756
|
+
font_size: int=26,
|
|
643
757
|
scatter_color: str='tab:blue',
|
|
644
758
|
scatter_alpha: float=0.6,
|
|
645
759
|
ideal_line_color: str='k',
|
|
646
760
|
residual_line_color: str='red',
|
|
647
|
-
hist_bins: Union[int, str] = 'auto'
|
|
761
|
+
hist_bins: Union[int, str] = 'auto',
|
|
762
|
+
xtick_size: int=22,
|
|
763
|
+
ytick_size: int=22) -> None:
|
|
648
764
|
super().__init__(font_size=font_size,
|
|
649
765
|
scatter_color=scatter_color,
|
|
650
766
|
scatter_alpha=scatter_alpha,
|
|
651
767
|
ideal_line_color=ideal_line_color,
|
|
652
768
|
residual_line_color=residual_line_color,
|
|
653
|
-
hist_bins=hist_bins
|
|
769
|
+
hist_bins=hist_bins,
|
|
770
|
+
xtick_size=xtick_size,
|
|
771
|
+
ytick_size=ytick_size)
|
|
654
772
|
|
|
655
773
|
|
|
656
774
|
# Multitarget regression
|
|
@@ -659,18 +777,22 @@ class MultiTargetRegressionMetricsFormat(_BaseRegressionFormat):
|
|
|
659
777
|
Configuration for multi-target regression.
|
|
660
778
|
"""
|
|
661
779
|
def __init__(self,
|
|
662
|
-
font_size: int=
|
|
780
|
+
font_size: int=26,
|
|
663
781
|
scatter_color: str='tab:blue',
|
|
664
782
|
scatter_alpha: float=0.6,
|
|
665
783
|
ideal_line_color: str='k',
|
|
666
784
|
residual_line_color: str='red',
|
|
667
|
-
hist_bins: Union[int, str] = 'auto'
|
|
785
|
+
hist_bins: Union[int, str] = 'auto',
|
|
786
|
+
xtick_size: int=22,
|
|
787
|
+
ytick_size: int=22) -> None:
|
|
668
788
|
super().__init__(font_size=font_size,
|
|
669
789
|
scatter_color=scatter_color,
|
|
670
790
|
scatter_alpha=scatter_alpha,
|
|
671
791
|
ideal_line_color=ideal_line_color,
|
|
672
792
|
residual_line_color=residual_line_color,
|
|
673
|
-
hist_bins=hist_bins
|
|
793
|
+
hist_bins=hist_bins,
|
|
794
|
+
xtick_size=xtick_size,
|
|
795
|
+
ytick_size=ytick_size)
|
|
674
796
|
|
|
675
797
|
|
|
676
798
|
# Classification
|
|
@@ -682,11 +804,20 @@ class BinaryClassificationMetricsFormat(_BaseClassificationFormat):
|
|
|
682
804
|
cmap: str="BuGn",
|
|
683
805
|
ROC_PR_line: str='darkorange',
|
|
684
806
|
calibration_bins: int=15,
|
|
685
|
-
font_size: int=
|
|
807
|
+
font_size: int=26,
|
|
808
|
+
xtick_size: int=22,
|
|
809
|
+
ytick_size: int=22,
|
|
810
|
+
legend_size: int=26,
|
|
811
|
+
cm_font_size: int=26
|
|
812
|
+
) -> None:
|
|
686
813
|
super().__init__(cmap=cmap,
|
|
687
814
|
ROC_PR_line=ROC_PR_line,
|
|
688
815
|
calibration_bins=calibration_bins,
|
|
689
|
-
font_size=font_size
|
|
816
|
+
font_size=font_size,
|
|
817
|
+
xtick_size=xtick_size,
|
|
818
|
+
ytick_size=ytick_size,
|
|
819
|
+
legend_size=legend_size,
|
|
820
|
+
cm_font_size=cm_font_size)
|
|
690
821
|
|
|
691
822
|
|
|
692
823
|
class MultiClassClassificationMetricsFormat(_BaseClassificationFormat):
|
|
@@ -697,12 +828,20 @@ class MultiClassClassificationMetricsFormat(_BaseClassificationFormat):
|
|
|
697
828
|
cmap: str="BuGn",
|
|
698
829
|
ROC_PR_line: str='darkorange',
|
|
699
830
|
calibration_bins: int=15,
|
|
700
|
-
font_size: int=
|
|
831
|
+
font_size: int=26,
|
|
832
|
+
xtick_size: int=22,
|
|
833
|
+
ytick_size: int=22,
|
|
834
|
+
legend_size: int=26,
|
|
835
|
+
cm_font_size: int=26
|
|
836
|
+
) -> None:
|
|
701
837
|
super().__init__(cmap=cmap,
|
|
702
838
|
ROC_PR_line=ROC_PR_line,
|
|
703
839
|
calibration_bins=calibration_bins,
|
|
704
|
-
font_size=font_size
|
|
705
|
-
|
|
840
|
+
font_size=font_size,
|
|
841
|
+
xtick_size=xtick_size,
|
|
842
|
+
ytick_size=ytick_size,
|
|
843
|
+
legend_size=legend_size,
|
|
844
|
+
cm_font_size=cm_font_size)
|
|
706
845
|
|
|
707
846
|
class BinaryImageClassificationMetricsFormat(_BaseClassificationFormat):
|
|
708
847
|
"""
|
|
@@ -712,12 +851,20 @@ class BinaryImageClassificationMetricsFormat(_BaseClassificationFormat):
|
|
|
712
851
|
cmap: str="BuGn",
|
|
713
852
|
ROC_PR_line: str='darkorange',
|
|
714
853
|
calibration_bins: int=15,
|
|
715
|
-
font_size: int=
|
|
854
|
+
font_size: int=26,
|
|
855
|
+
xtick_size: int=22,
|
|
856
|
+
ytick_size: int=22,
|
|
857
|
+
legend_size: int=26,
|
|
858
|
+
cm_font_size: int=26
|
|
859
|
+
) -> None:
|
|
716
860
|
super().__init__(cmap=cmap,
|
|
717
861
|
ROC_PR_line=ROC_PR_line,
|
|
718
862
|
calibration_bins=calibration_bins,
|
|
719
|
-
font_size=font_size
|
|
720
|
-
|
|
863
|
+
font_size=font_size,
|
|
864
|
+
xtick_size=xtick_size,
|
|
865
|
+
ytick_size=ytick_size,
|
|
866
|
+
legend_size=legend_size,
|
|
867
|
+
cm_font_size=cm_font_size)
|
|
721
868
|
|
|
722
869
|
class MultiClassImageClassificationMetricsFormat(_BaseClassificationFormat):
|
|
723
870
|
"""
|
|
@@ -727,12 +874,20 @@ class MultiClassImageClassificationMetricsFormat(_BaseClassificationFormat):
|
|
|
727
874
|
cmap: str="BuGn",
|
|
728
875
|
ROC_PR_line: str='darkorange',
|
|
729
876
|
calibration_bins: int=15,
|
|
730
|
-
font_size: int=
|
|
877
|
+
font_size: int=26,
|
|
878
|
+
xtick_size: int=22,
|
|
879
|
+
ytick_size: int=22,
|
|
880
|
+
legend_size: int=26,
|
|
881
|
+
cm_font_size: int=26
|
|
882
|
+
) -> None:
|
|
731
883
|
super().__init__(cmap=cmap,
|
|
732
884
|
ROC_PR_line=ROC_PR_line,
|
|
733
885
|
calibration_bins=calibration_bins,
|
|
734
|
-
font_size=font_size
|
|
735
|
-
|
|
886
|
+
font_size=font_size,
|
|
887
|
+
xtick_size=xtick_size,
|
|
888
|
+
ytick_size=ytick_size,
|
|
889
|
+
legend_size=legend_size,
|
|
890
|
+
cm_font_size=cm_font_size)
|
|
736
891
|
|
|
737
892
|
# Multi-Label classification
|
|
738
893
|
class MultiLabelBinaryClassificationMetricsFormat(_BaseMultiLabelFormat):
|
|
@@ -742,11 +897,17 @@ class MultiLabelBinaryClassificationMetricsFormat(_BaseMultiLabelFormat):
|
|
|
742
897
|
def __init__(self,
|
|
743
898
|
cmap: str = "BuGn",
|
|
744
899
|
ROC_PR_line: str='darkorange',
|
|
745
|
-
font_size: int =
|
|
900
|
+
font_size: int = 25,
|
|
901
|
+
xtick_size: int=20,
|
|
902
|
+
ytick_size: int=20,
|
|
903
|
+
legend_size: int=23
|
|
904
|
+
) -> None:
|
|
746
905
|
super().__init__(cmap=cmap,
|
|
747
906
|
ROC_PR_line=ROC_PR_line,
|
|
748
|
-
font_size=font_size
|
|
749
|
-
|
|
907
|
+
font_size=font_size,
|
|
908
|
+
xtick_size=xtick_size,
|
|
909
|
+
ytick_size=ytick_size,
|
|
910
|
+
legend_size=legend_size)
|
|
750
911
|
|
|
751
912
|
# Segmentation
|
|
752
913
|
class BinarySegmentationMetricsFormat(_BaseSegmentationFormat):
|
|
@@ -781,7 +942,7 @@ class SequenceValueMetricsFormat(_BaseSequenceValueFormat):
|
|
|
781
942
|
Configuration for sequence-to-value prediction.
|
|
782
943
|
"""
|
|
783
944
|
def __init__(self,
|
|
784
|
-
font_size: int=
|
|
945
|
+
font_size: int=25,
|
|
785
946
|
scatter_color: str='tab:blue',
|
|
786
947
|
scatter_alpha: float=0.6,
|
|
787
948
|
ideal_line_color: str='k',
|
|
@@ -800,15 +961,13 @@ class SequenceSequenceMetricsFormat(_BaseSequenceSequenceFormat):
|
|
|
800
961
|
Configuration for sequence-to-sequence prediction.
|
|
801
962
|
"""
|
|
802
963
|
def __init__(self,
|
|
803
|
-
font_size: int =
|
|
804
|
-
plot_figsize: tuple[int, int] = (10, 6),
|
|
964
|
+
font_size: int = 25,
|
|
805
965
|
grid_style: str = '--',
|
|
806
966
|
rmse_color: str = 'tab:blue',
|
|
807
967
|
rmse_marker: str = 'o-',
|
|
808
968
|
mae_color: str = 'tab:orange',
|
|
809
969
|
mae_marker: str = 's--'):
|
|
810
970
|
super().__init__(font_size=font_size,
|
|
811
|
-
plot_figsize=plot_figsize,
|
|
812
971
|
grid_style=grid_style,
|
|
813
972
|
rmse_color=rmse_color,
|
|
814
973
|
rmse_marker=rmse_marker,
|