dragon-ml-toolbox 19.12.0__tar.gz → 19.12.2__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.12.0/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-19.12.2}/PKG-INFO +1 -1
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2/dragon_ml_toolbox.egg-info}/PKG-INFO +1 -1
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_IO_tools.py +8 -2
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_configuration.py +15 -6
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_finalize_handler.py +5 -4
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_trainer.py +3 -3
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_data_exploration.py +3 -2
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_utilities.py +1 -1
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/pyproject.toml +1 -1
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/LICENSE +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/LICENSE-THIRD-PARTY.md +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/README.md +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ETL_cleaning.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ETL_engineering.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/GUI_tools.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/IO_tools.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/MICE_imputation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_callbacks.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_chaining_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_chaining_utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_configuration.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_configuration_pytab.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_evaluation_captum.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_evaluation_multi.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_finalize_handler.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_models.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_models_advanced.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_models_pytab.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_optimization.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_optimization_pareto.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_scaler.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_sequence_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_sequence_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_sequence_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_sequence_models.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_trainer.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_vision_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_vision_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_vision_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_vision_models.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_vision_transformers.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/PSO_optimization.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/SQL.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/VIF_factor.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/__init__.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ETL_cleaning.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ETL_engineering.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_GUI_tools.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_MICE_imputation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_callbacks.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_chaining_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_chaining_utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_configuration_pytab.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_evaluation_captum.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_evaluation_multi.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_models.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_models_advanced.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_models_pytab.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_optimization.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_optimization_pareto.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_scaler.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_models.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_datasetmaster.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_models.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_transformers.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_PSO_optimization.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_SQL.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_VIF_factor.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/__init__.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ensemble_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ensemble_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ensemble_learning.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_excel_handler.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_keys.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_logger.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_math_utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_models_advanced_base.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_models_advanced_helpers.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_optimization_tools.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_path_manager.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_plot_fonts.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_schema.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_script_info.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_serde.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/constants.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/data_exploration.py +3 -3
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ensemble_evaluation.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ensemble_inference.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ensemble_learning.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/excel_handler.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/keys.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/math_utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/optimization_tools.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/path_manager.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/plot_fonts.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/schema.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/serde.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/utilities.py +0 -0
- {dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dragon-ml-toolbox
|
|
3
|
-
Version: 19.12.
|
|
3
|
+
Version: 19.12.2
|
|
4
4
|
Summary: Complete pipelines and helper tools for data science and machine learning projects.
|
|
5
5
|
Author-email: Karl Luigi Loza Vidaurre <luigiloza@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dragon-ml-toolbox
|
|
3
|
-
Version: 19.12.
|
|
3
|
+
Version: 19.12.2
|
|
4
4
|
Summary: Complete pipelines and helper tools for data science and machine learning projects.
|
|
5
5
|
Author-email: Karl Luigi Loza Vidaurre <luigiloza@gmail.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -434,8 +434,8 @@ def train_logger(train_config: Union[dict, Any],
|
|
|
434
434
|
Logs training data to JSON, adding a timestamp to the filename.
|
|
435
435
|
|
|
436
436
|
Args:
|
|
437
|
-
train_config (dict | Any): Training configuration parameters.
|
|
438
|
-
model_parameters (dict | Any): Model parameters.
|
|
437
|
+
train_config (dict | Any): Training configuration parameters. If object, must have a `.to_log()` method returning a dict.
|
|
438
|
+
model_parameters (dict | Any): Model parameters. If object, must have a `.to_log()` method returning a dict.
|
|
439
439
|
train_history (dict | None): Training history log.
|
|
440
440
|
save_directory (str | Path): Directory to save the log file.
|
|
441
441
|
"""
|
|
@@ -443,6 +443,9 @@ def train_logger(train_config: Union[dict, Any],
|
|
|
443
443
|
if not isinstance(train_config, dict):
|
|
444
444
|
if hasattr(train_config, "to_log") and callable(getattr(train_config, "to_log")):
|
|
445
445
|
train_config_dict: dict = train_config.to_log()
|
|
446
|
+
if not isinstance(train_config_dict, dict):
|
|
447
|
+
_LOGGER.error("'train_config.to_log()' did not return a dictionary.")
|
|
448
|
+
raise ValueError()
|
|
446
449
|
else:
|
|
447
450
|
_LOGGER.error("'train_config' must be a dict or an object with a 'to_log()' method.")
|
|
448
451
|
raise ValueError()
|
|
@@ -458,6 +461,9 @@ def train_logger(train_config: Union[dict, Any],
|
|
|
458
461
|
if not isinstance(model_parameters, dict):
|
|
459
462
|
if hasattr(model_parameters, "to_log") and callable(getattr(model_parameters, "to_log")):
|
|
460
463
|
model_parameters_dict: dict = model_parameters.to_log()
|
|
464
|
+
if not isinstance(model_parameters_dict, dict):
|
|
465
|
+
_LOGGER.error("'model_parameters.to_log()' did not return a dictionary.")
|
|
466
|
+
raise ValueError()
|
|
461
467
|
else:
|
|
462
468
|
_LOGGER.error("'model_parameters' must be a dict or an object with a 'to_log()' method.")
|
|
463
469
|
raise ValueError()
|
|
@@ -660,18 +660,27 @@ class DragonTrainingConfig(_BaseModelParams):
|
|
|
660
660
|
initial_learning_rate: float,
|
|
661
661
|
batch_size: int,
|
|
662
662
|
random_state: int = 101,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
663
|
+
# early_stop_patience: Optional[int] = None,
|
|
664
|
+
# scheduler_patience: Optional[int] = None,
|
|
665
|
+
# scheduler_lr_factor: Optional[float] = None,
|
|
666
666
|
**kwargs: Any) -> None:
|
|
667
|
+
"""
|
|
668
|
+
Args:
|
|
669
|
+
validation_size (float): Proportion of data for validation set.
|
|
670
|
+
test_size (float): Proportion of data for test set.
|
|
671
|
+
initial_learning_rate (float): Starting learning rate.
|
|
672
|
+
batch_size (int): Number of samples per training batch.
|
|
673
|
+
random_state (int): Seed for reproducibility.
|
|
674
|
+
**kwargs: Additional training parameters as key-value pairs.
|
|
675
|
+
"""
|
|
667
676
|
self.validation_size = validation_size
|
|
668
677
|
self.test_size = test_size
|
|
669
678
|
self.initial_learning_rate = initial_learning_rate
|
|
670
679
|
self.batch_size = batch_size
|
|
671
680
|
self.random_state = random_state
|
|
672
|
-
self.early_stop_patience = early_stop_patience
|
|
673
|
-
self.scheduler_patience = scheduler_patience
|
|
674
|
-
self.scheduler_lr_factor = scheduler_lr_factor
|
|
681
|
+
# self.early_stop_patience = early_stop_patience
|
|
682
|
+
# self.scheduler_patience = scheduler_patience
|
|
683
|
+
# self.scheduler_lr_factor = scheduler_lr_factor
|
|
675
684
|
|
|
676
685
|
# Process kwargs with validation
|
|
677
686
|
for key, value in kwargs.items():
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_finalize_handler.py
RENAMED
|
@@ -51,7 +51,7 @@ class FinalizedFileHandler:
|
|
|
51
51
|
self._initial_sequence: Optional[np.ndarray] = None
|
|
52
52
|
self._target_name: Optional[str] = None
|
|
53
53
|
self._target_names: Optional[list[str]] = None
|
|
54
|
-
self._model_state_dict: Optional[Any] = None
|
|
54
|
+
self._model_state_dict: Optional[dict[str, Any]] = None
|
|
55
55
|
|
|
56
56
|
# Set warning outputs
|
|
57
57
|
self._verbose: bool=True
|
|
@@ -90,7 +90,7 @@ class FinalizedFileHandler:
|
|
|
90
90
|
|
|
91
91
|
else:
|
|
92
92
|
# It is a dict, but missing the keys, assume it is the raw state dict
|
|
93
|
-
_LOGGER.
|
|
93
|
+
_LOGGER.warning(f"File '{pth_path.name}' does not have the required keys for a Dragon-ML finalized-file. Keys found:\n {list(pth_file_content.keys())}")
|
|
94
94
|
self._model_state_dict = pth_file_content
|
|
95
95
|
|
|
96
96
|
|
|
@@ -113,9 +113,10 @@ class FinalizedFileHandler:
|
|
|
113
113
|
return self._task
|
|
114
114
|
|
|
115
115
|
@property
|
|
116
|
-
def model_state_dict(self):
|
|
116
|
+
def model_state_dict(self) -> dict[str, Any]:
|
|
117
117
|
"""Returns the model state dictionary."""
|
|
118
|
-
|
|
118
|
+
# No need to check for None, as it is guaranteed to be set in __init__
|
|
119
|
+
return self._model_state_dict # type: ignore
|
|
119
120
|
|
|
120
121
|
@property
|
|
121
122
|
def epoch(self) -> Optional[int]:
|
|
@@ -663,7 +663,7 @@ class DragonTrainer(_BaseDragonTrainer):
|
|
|
663
663
|
Evaluates the model, routing to the correct evaluation function based on task `kind`.
|
|
664
664
|
|
|
665
665
|
Args:
|
|
666
|
-
model_checkpoint (
|
|
666
|
+
model_checkpoint (Path | "best" | "current"):
|
|
667
667
|
- Path to a valid checkpoint for the model. The state of the trained model will be overwritten in place.
|
|
668
668
|
- If 'best', the best checkpoint will be loaded if a DragonModelCheckpoint was provided. The state of the trained model will be overwritten in place.
|
|
669
669
|
- If 'current', use the current state of the trained model up the latest trained epoch.
|
|
@@ -1608,7 +1608,7 @@ class DragonDetectionTrainer(_BaseDragonTrainer):
|
|
|
1608
1608
|
|
|
1609
1609
|
Args:
|
|
1610
1610
|
save_dir (str | Path): Directory to save all reports and plots.
|
|
1611
|
-
model_checkpoint (
|
|
1611
|
+
model_checkpoint (Path | "best" | "current"):
|
|
1612
1612
|
- Path to a valid checkpoint for the model. The state of the trained model will be overwritten in place.
|
|
1613
1613
|
- If 'best', the best checkpoint will be loaded if a DragonModelCheckpoint was provided. The state of the trained model will be overwritten in place.
|
|
1614
1614
|
- If 'current', use the current state of the trained model up the latest trained epoch.
|
|
@@ -2046,7 +2046,7 @@ class DragonSequenceTrainer(_BaseDragonTrainer):
|
|
|
2046
2046
|
Evaluates the model, routing to the correct evaluation function.
|
|
2047
2047
|
|
|
2048
2048
|
Args:
|
|
2049
|
-
model_checkpoint (
|
|
2049
|
+
model_checkpoint (Path | "best" | "current"):
|
|
2050
2050
|
- Path to a valid checkpoint for the model.
|
|
2051
2051
|
- If 'best', the best checkpoint will be loaded.
|
|
2052
2052
|
- If 'current', use the current state of the trained model.
|
|
@@ -17,7 +17,6 @@ from ._schema import FeatureSchema
|
|
|
17
17
|
_LOGGER = get_logger("Data Exploration")
|
|
18
18
|
|
|
19
19
|
|
|
20
|
-
# Keep track of all available tools, show using `info()`
|
|
21
20
|
__all__ = [
|
|
22
21
|
"summarize_dataframe",
|
|
23
22
|
"drop_constant_columns",
|
|
@@ -754,6 +753,8 @@ def plot_categorical_vs_target(
|
|
|
754
753
|
This function is a core EDA step for regression tasks to understand the
|
|
755
754
|
relationship between a categorical independent variable and a continuous
|
|
756
755
|
dependent variable.
|
|
756
|
+
|
|
757
|
+
Plots are saved as individual .svg files in a structured way, with a subdirectory created for each target.
|
|
757
758
|
|
|
758
759
|
Args:
|
|
759
760
|
df (pd.DataFrame): The input DataFrame.
|
|
@@ -1167,7 +1168,7 @@ def clip_outliers_single(
|
|
|
1167
1168
|
|
|
1168
1169
|
def clip_outliers_multi(
|
|
1169
1170
|
df: pd.DataFrame,
|
|
1170
|
-
clip_dict: Dict[str, Tuple[
|
|
1171
|
+
clip_dict: Union[Dict[str, Tuple[int, int]], Dict[str, Tuple[float, float]]],
|
|
1171
1172
|
verbose: bool=False
|
|
1172
1173
|
) -> pd.DataFrame:
|
|
1173
1174
|
"""
|
|
@@ -396,7 +396,7 @@ def save_dataframe(df: Union[pd.DataFrame, pl.DataFrame], full_path: Path):
|
|
|
396
396
|
if not isinstance(full_path, Path) or not full_path.suffix.endswith(".csv"):
|
|
397
397
|
_LOGGER.error('A path object pointing to a .csv file must be provided.')
|
|
398
398
|
raise ValueError()
|
|
399
|
-
|
|
399
|
+
|
|
400
400
|
save_dataframe_filename(df=df,
|
|
401
401
|
save_dir=full_path.parent,
|
|
402
402
|
filename=full_path.name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "dragon-ml-toolbox"
|
|
3
|
-
version = "19.12.
|
|
3
|
+
version = "19.12.2"
|
|
4
4
|
description = "Complete pipelines and helper tools for data science and machine learning projects."
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Karl Luigi Loza Vidaurre", email = "luigiloza@gmail.com" }
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/requires.txt
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/dragon_ml_toolbox.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/ML_sequence_datasetmaster.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_chaining_inference.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_chaining_utilities.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_configuration_pytab.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_evaluation_captum.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_evaluation_multi.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_models_advanced.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_optimization_pareto.py
RENAMED
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_datasetmaster.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_evaluation.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_inference.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_sequence_models.py
RENAMED
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_datasetmaster.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_evaluation.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_inference.py
RENAMED
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ML_vision_transformers.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ensemble_evaluation.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ensemble_inference.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_ensemble_learning.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_models_advanced_base.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_models_advanced_helpers.py
RENAMED
|
File without changes
|
{dragon_ml_toolbox-19.12.0 → dragon_ml_toolbox-19.12.2}/ml_tools/_core/_optimization_tools.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -37,18 +37,18 @@ __all__ = [
|
|
|
37
37
|
"plot_value_distributions",
|
|
38
38
|
"plot_continuous_vs_target",
|
|
39
39
|
"plot_categorical_vs_target",
|
|
40
|
-
"encode_categorical_features",
|
|
41
40
|
"split_features_targets",
|
|
42
|
-
"
|
|
41
|
+
"encode_categorical_features",
|
|
43
42
|
"clip_outliers_single",
|
|
44
43
|
"clip_outliers_multi",
|
|
45
44
|
"drop_outlier_samples",
|
|
46
45
|
"plot_correlation_heatmap",
|
|
46
|
+
"finalize_feature_schema",
|
|
47
47
|
"match_and_filter_columns_by_regex",
|
|
48
48
|
"standardize_percentages",
|
|
49
49
|
"reconstruct_one_hot",
|
|
50
50
|
"reconstruct_binary",
|
|
51
51
|
"reconstruct_multibinary",
|
|
52
|
-
"
|
|
52
|
+
"split_continuous_binary",
|
|
53
53
|
"apply_feature_schema",
|
|
54
54
|
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|