dragon-ml-toolbox 13.2.1__tar.gz → 13.3.1__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.

Potentially problematic release.


This version of dragon-ml-toolbox might be problematic. Click here for more details.

Files changed (46) hide show
  1. {dragon_ml_toolbox-13.2.1/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-13.3.1}/PKG-INFO +1 -1
  2. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1/dragon_ml_toolbox.egg-info}/PKG-INFO +1 -1
  3. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/_schema.py +11 -0
  4. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/data_exploration.py +1 -1
  5. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/serde.py +23 -3
  6. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/pyproject.toml +1 -1
  7. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/LICENSE +0 -0
  8. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/LICENSE-THIRD-PARTY.md +0 -0
  9. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/README.md +0 -0
  10. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
  11. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
  12. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
  13. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
  14. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ETL_cleaning.py +0 -0
  15. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ETL_engineering.py +0 -0
  16. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/GUI_tools.py +0 -0
  17. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/MICE_imputation.py +0 -0
  18. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_callbacks.py +0 -0
  19. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_datasetmaster.py +0 -0
  20. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_evaluation.py +0 -0
  21. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_evaluation_multi.py +0 -0
  22. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_inference.py +0 -0
  23. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_models.py +0 -0
  24. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_optimization.py +0 -0
  25. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_scaler.py +0 -0
  26. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_trainer.py +0 -0
  27. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ML_utilities.py +0 -0
  28. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/PSO_optimization.py +0 -0
  29. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/RNN_forecast.py +0 -0
  30. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/SQL.py +0 -0
  31. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/VIF_factor.py +0 -0
  32. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/__init__.py +0 -0
  33. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/_logger.py +0 -0
  34. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/_script_info.py +0 -0
  35. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/constants.py +0 -0
  36. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/custom_logger.py +0 -0
  37. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ensemble_evaluation.py +0 -0
  38. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ensemble_inference.py +0 -0
  39. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/ensemble_learning.py +0 -0
  40. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/handle_excel.py +0 -0
  41. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/keys.py +0 -0
  42. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/math_utilities.py +0 -0
  43. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/optimization_tools.py +0 -0
  44. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/path_manager.py +0 -0
  45. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/ml_tools/utilities.py +0 -0
  46. {dragon_ml_toolbox-13.2.1 → dragon_ml_toolbox-13.3.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 13.2.1
3
+ Version: 13.3.1
4
4
  Summary: A collection of tools for data science and machine learning projects.
5
5
  Author-email: "Karl L. 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: 13.2.1
3
+ Version: 13.3.1
4
4
  Summary: A collection of tools for data science and machine learning projects.
5
5
  Author-email: "Karl L. Loza Vidaurre" <luigiloza@gmail.com>
6
6
  License-Expression: MIT
@@ -83,3 +83,14 @@ class FeatureSchema(NamedTuple):
83
83
  self.save_all_features(directory=directory, verbose=True)
84
84
  self.save_continuous_features(directory=directory, verbose=True)
85
85
  self.save_categorical_features(directory=directory, verbose=True)
86
+
87
+ def __repr__(self) -> str:
88
+ """Returns a concise representation of the schema's contents."""
89
+ total = len(self.feature_names)
90
+ cont = len(self.continuous_feature_names)
91
+ cat = len(self.categorical_feature_names)
92
+ index_map = self.categorical_index_map is not None
93
+ cat_map = self.categorical_mappings is not None
94
+ return (
95
+ f"<FeatureSchema(total={total}, continuous={cont}, categorical={cat}, index_map={index_map}, categorical_map={cat_map})>"
96
+ )
@@ -1262,7 +1262,7 @@ def finalize_feature_schema(
1262
1262
  categorical_feature_names_list: List[str] = []
1263
1263
  categorical_index_map_dict: Dict[int, int] = {}
1264
1264
 
1265
- _LOGGER.info("Finalizing feature schema...")
1265
+ # _LOGGER.info("Finalizing feature schema...")
1266
1266
 
1267
1267
  if categorical_mappings:
1268
1268
  # --- Categorical features are present ---
@@ -18,6 +18,10 @@ __all__ = [
18
18
  ]
19
19
 
20
20
 
21
+ # Base types that have a generic `type()` log.
22
+ _SIMPLE_TYPES = (list, dict, tuple, set, str, int, float, bool)
23
+
24
+
21
25
  def serialize_object_filename(obj: Any, save_dir: Union[str,Path], filename: str, verbose: bool=True, raise_on_error: bool=False) -> None:
22
26
  """
23
27
  Serializes a Python object using joblib; suitable for Python built-ins, numpy, and pandas.
@@ -27,6 +31,10 @@ def serialize_object_filename(obj: Any, save_dir: Union[str,Path], filename: str
27
31
  save_dir (str | Path) : Directory path where the serialized object will be saved.
28
32
  filename (str) : Name for the output file, extension will be appended if needed.
29
33
  """
34
+ if obj is None:
35
+ _LOGGER.warning(f"Attempted to serialize a None object. Skipping save for '{filename}'.")
36
+ return
37
+
30
38
  try:
31
39
  save_path = make_fullpath(save_dir, make=True, enforce="directory")
32
40
  sanitized_name = sanitize_filename(filename)
@@ -56,6 +64,10 @@ def serialize_object(obj: Any, file_path: Path, verbose: bool = True, raise_on_e
56
64
  '.joblib' extension will be appended if missing.
57
65
  raise_on_error (bool) : If True, raises exceptions on failure.
58
66
  """
67
+ if obj is None:
68
+ _LOGGER.warning(f"Attempted to serialize a None object. Skipping save for '{file_path}'.")
69
+ return
70
+
59
71
  try:
60
72
  # Ensure the extension is correct
61
73
  file_path = file_path.with_suffix('.joblib')
@@ -73,7 +85,11 @@ def serialize_object(obj: Any, file_path: Path, verbose: bool = True, raise_on_e
73
85
  return None
74
86
  else:
75
87
  if verbose:
76
- _LOGGER.info(f"Object of type '{type(obj)}' saved to '{file_path}'")
88
+ if type(obj) in _SIMPLE_TYPES:
89
+ _LOGGER.info(f"Object of type '{type(obj)}' saved to '{file_path}'")
90
+ else:
91
+ _LOGGER.info(f"Object '{obj}' saved to '{file_path}'")
92
+
77
93
  return None
78
94
 
79
95
 
@@ -123,9 +139,13 @@ def deserialize_object(
123
139
  raise TypeError()
124
140
 
125
141
  if verbose:
126
- _LOGGER.info(f"Loaded object of type '{type(obj)}' from '{true_filepath}'.")
142
+ # log special objects
143
+ if type(obj) in _SIMPLE_TYPES:
144
+ _LOGGER.info(f"Loaded object of type '{type(obj)}' from '{true_filepath}'.")
145
+ else:
146
+ _LOGGER.info(f"Loaded object '{obj}' from '{true_filepath}'.")
127
147
 
128
- return obj
148
+ return obj # type: ignore
129
149
 
130
150
 
131
151
  def serialize_schema(schema: FeatureSchema, file_path: Path):
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dragon-ml-toolbox"
3
- version = "13.2.1"
3
+ version = "13.3.1"
4
4
  description = "A collection of tools for data science and machine learning projects."
5
5
  authors = [
6
6
  { name = "Karl L. Loza Vidaurre", email = "luigiloza@gmail.com" }