dragon-ml-toolbox 3.10.1__py3-none-any.whl → 3.10.2__py3-none-any.whl

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 3.10.1
3
+ Version: 3.10.2
4
4
  Summary: A collection of tools for data science and machine learning projects.
5
5
  Author-email: Karl Loza <luigiloza@gmail.com>
6
6
  License-Expression: MIT
@@ -1,7 +1,7 @@
1
- dragon_ml_toolbox-3.10.1.dist-info/licenses/LICENSE,sha256=2uUFNy7D0TLgHim1K5s3DIJ4q_KvxEXVilnU20cWliY,1066
2
- dragon_ml_toolbox-3.10.1.dist-info/licenses/LICENSE-THIRD-PARTY.md,sha256=lY4_rJPnLnMu7YBQaY-_iz1JRDcLdQzNCyeLAF1glJY,1837
1
+ dragon_ml_toolbox-3.10.2.dist-info/licenses/LICENSE,sha256=2uUFNy7D0TLgHim1K5s3DIJ4q_KvxEXVilnU20cWliY,1066
2
+ dragon_ml_toolbox-3.10.2.dist-info/licenses/LICENSE-THIRD-PARTY.md,sha256=lY4_rJPnLnMu7YBQaY-_iz1JRDcLdQzNCyeLAF1glJY,1837
3
3
  ml_tools/ETL_engineering.py,sha256=yeZsW_7zRvEcuMZbM4E2GV1dxwBoWIeJAcFFk2AK0fY,39502
4
- ml_tools/GUI_tools.py,sha256=EjO8T5WXoBV5Rj7tLZFsNf_O0FuXlpjn2r-k6nUSpJQ,20710
4
+ ml_tools/GUI_tools.py,sha256=bsav1gBo8Pj6bnGo72Bd5RmlZljzVyZrQLLHf6ZZdjM,21500
5
5
  ml_tools/MICE_imputation.py,sha256=rYqvwQDVtoAJJ0agXWoGzoZEHedWiA6QzcEKEIkiZ08,11388
6
6
  ml_tools/ML_callbacks.py,sha256=g_9nSzoA22UJOQZCPKeDz-Ayh0ECFZLzRd6rZ8SokrE,13080
7
7
  ml_tools/ML_evaluation.py,sha256=oiDV6HItQloUUKCUpltV-2pogubWLBieGpc-VUwosAQ,10106
@@ -14,13 +14,13 @@ ml_tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
14
  ml_tools/_pytorch_models.py,sha256=bpWZsrSwCvHJQkR6UfoPpElsMv9AvmiNErNHC8NYB_I,10132
15
15
  ml_tools/data_exploration.py,sha256=M7bn2q5XN9zJZJGAmMMFSFFZh8LGzC2arFelrXw3N6Q,25241
16
16
  ml_tools/datasetmaster.py,sha256=S3PKHNQZ9cyAOck8xQltVLZhaD1gFLfgHFL-aRjz4JU,30077
17
- ml_tools/ensemble_learning.py,sha256=Dp3fAzleQxMuMGOgFU4kiAADseIf7D-RBb05KR4tZp8,45637
17
+ ml_tools/ensemble_learning.py,sha256=0Ld6jwVRthG-IgtEKw68Hh1K5G-Jx1Sk5MdXnmvKL9M,45663
18
18
  ml_tools/handle_excel.py,sha256=lwds7rDLlGSCWiWGI7xNg-Z7kxAepogp0lstSFa0590,12949
19
19
  ml_tools/keys.py,sha256=pwn7IkqQ00r1rspq7vV2fHJVSg5TTOQ_cPTqM-PewGE,536
20
20
  ml_tools/logger.py,sha256=UkbiU9ihBhw9VKyn3rZzisdClWV94EBV6B09_D0iUU0,6026
21
21
  ml_tools/path_manager.py,sha256=OCpESgdftbi6mOxetDMIaHhazt4N-W8pJx11X3-yNOs,8305
22
22
  ml_tools/utilities.py,sha256=FW97hMTLLxjDR1so-C-_yDm_iz2z_YfirRXjG_IwSLo,22843
23
- dragon_ml_toolbox-3.10.1.dist-info/METADATA,sha256=GGLu9cNhkX0gg5jNi9VhdtIpX69_qXN5J3WKNo-1nfU,3274
24
- dragon_ml_toolbox-3.10.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
- dragon_ml_toolbox-3.10.1.dist-info/top_level.txt,sha256=wm-oxax3ciyez6VoO4zsFd-gSok2VipYXnbg3TH9PtU,9
26
- dragon_ml_toolbox-3.10.1.dist-info/RECORD,,
23
+ dragon_ml_toolbox-3.10.2.dist-info/METADATA,sha256=kBiUOEZa1iZ9jl-VzV71G5vhr-qg4-WcmRoyH_fTFgA,3274
24
+ dragon_ml_toolbox-3.10.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
25
+ dragon_ml_toolbox-3.10.2.dist-info/top_level.txt,sha256=wm-oxax3ciyez6VoO4zsFd-gSok2VipYXnbg3TH9PtU,9
26
+ dragon_ml_toolbox-3.10.2.dist-info/RECORD,,
ml_tools/GUI_tools.py CHANGED
@@ -497,18 +497,34 @@ class BaseFeatureHandler(ABC):
497
497
  return np.array(final_vector, dtype=np.float32)
498
498
 
499
499
 
500
- def update_target_fields(window: sg.Window, results_dict: Dict[str, Any]):
500
+ def update_target_fields(window: sg.Window, results_dict: Dict[str, Any], map_model_to_gui: Optional[Dict[str,str]]):
501
501
  """
502
502
  Updates the GUI's target fields with inference results.
503
503
 
504
504
  Args:
505
505
  window (sg.Window): The application's window object.
506
- results_dict (dict): A dictionary where keys are target element-keys and values are the predicted results to update.
506
+ results_dict (dict): A dictionary where keys are target names (as expected by the GUI) and values are the predicted results to update.
507
+ map_model_to_gui (dict | None): Map `results_dict.keys()` from model target names to GUI target names, if gui names were customized.
507
508
  """
508
- for target_name, result in results_dict.items():
509
+ if map_model_to_gui is not None:
510
+ # Validation
511
+ if len(map_model_to_gui) != len(results_dict):
512
+ _LOGGER.error(f"Expected a mapping for {len(results_dict)} targets, but received {len(map_model_to_gui)} target map names.")
513
+ raise ValueError
514
+
515
+ # new dictionary with GUI keys and corresponding result values
516
+ display_dict = {
517
+ gui_key: results_dict[model_key]
518
+ for model_key, gui_key in map_model_to_gui.items()
519
+ }
520
+ else:
521
+ # If no map is provided, use given result keys
522
+ display_dict = results_dict
523
+
524
+ for key, result in display_dict.items():
509
525
  # Format numbers to 2 decimal places, leave other types as-is
510
526
  display_value = f"{result:.2f}" if isinstance(result, (int, float)) else result
511
- window[target_name].update(display_value) # type: ignore
527
+ window[key].update(display_value) # type: ignore
512
528
 
513
529
 
514
530
  def info():
@@ -973,9 +973,9 @@ class InferenceHandler:
973
973
  verbose=self.verbose,
974
974
  raise_on_error=True) # type: ignore
975
975
 
976
- model: Any = full_object["model"]
977
- target_name: str = full_object["target_name"]
978
- feature_names_list: List[str] = full_object["feature_names"]
976
+ model: Any = full_object[ModelSaveKeys.MODEL]
977
+ target_name: str = full_object[ModelSaveKeys.TARGET]
978
+ feature_names_list: List[str] = full_object[ModelSaveKeys.FEATURES]
979
979
 
980
980
  # Check that feature names match
981
981
  if self._feature_names is None: