dragon-ml-toolbox 1.4.6__tar.gz → 1.4.8__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 (24) hide show
  1. {dragon_ml_toolbox-1.4.6/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-1.4.8}/PKG-INFO +1 -1
  2. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8/dragon_ml_toolbox.egg-info}/PKG-INFO +1 -1
  3. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/MICE_imputation.py +1 -1
  4. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/data_exploration.py +1 -1
  5. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/ensemble_learning.py +0 -1
  6. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/handle_excel.py +1 -1
  7. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/logger.py +1 -1
  8. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/particle_swarm_optimization.py +13 -6
  9. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/pyproject.toml +1 -1
  10. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/LICENSE +0 -0
  11. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/LICENSE-THIRD-PARTY.md +0 -0
  12. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/README.md +0 -0
  13. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
  14. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
  15. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
  16. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
  17. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/VIF_factor.py +0 -0
  18. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/__init__.py +0 -0
  19. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/datasetmaster.py +0 -0
  20. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/pytorch_models.py +0 -0
  21. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/trainer.py +0 -0
  22. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/utilities.py +0 -0
  23. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/vision_helpers.py +0 -0
  24. {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 1.4.6
3
+ Version: 1.4.8
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dragon-ml-toolbox
3
- Version: 1.4.6
3
+ Version: 1.4.8
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
@@ -3,7 +3,7 @@ import miceforest as mf
3
3
  import os
4
4
  import matplotlib.pyplot as plt
5
5
  import numpy as np
6
- from ml_tools.utilities import load_dataframe, list_csv_paths, sanitize_filename, _script_info, merge_dataframes, save_dataframe, threshold_binary_values
6
+ from .utilities import load_dataframe, list_csv_paths, sanitize_filename, _script_info, merge_dataframes, save_dataframe, threshold_binary_values
7
7
  from plotnine import ggplot, labs, theme, element_blank # type: ignore
8
8
  from typing import Optional
9
9
 
@@ -7,7 +7,7 @@ from IPython.display import clear_output
7
7
  import time
8
8
  from typing import Union, Literal, Dict, Tuple, List
9
9
  import os
10
- from ml_tools.utilities import sanitize_filename, _script_info
10
+ from .utilities import sanitize_filename, _script_info
11
11
  import re
12
12
 
13
13
 
@@ -7,7 +7,6 @@ from matplotlib import rcdefaults
7
7
 
8
8
  import os
9
9
  from typing import Literal, Union, Optional, Iterator, Tuple
10
- import joblib
11
10
 
12
11
  from imblearn.over_sampling import ADASYN, SMOTE, RandomOverSampler
13
12
  from imblearn.under_sampling import RandomUnderSampler
@@ -2,7 +2,7 @@ import os
2
2
  from openpyxl import load_workbook, Workbook
3
3
  import pandas as pd
4
4
  from typing import List, Optional
5
- from utilities import _script_info, sanitize_filename
5
+ from .utilities import _script_info, sanitize_filename
6
6
 
7
7
 
8
8
  __all__ = [
@@ -5,7 +5,7 @@ import pandas as pd
5
5
  from openpyxl.styles import Font, PatternFill
6
6
  import traceback
7
7
  import json
8
- from ml_tools.utilities import sanitize_filename, _script_info
8
+ from .utilities import sanitize_filename, _script_info
9
9
 
10
10
 
11
11
  __all__ = [
@@ -1,6 +1,5 @@
1
1
  import numpy as np
2
2
  import os
3
- import joblib
4
3
  import xgboost as xgb
5
4
  import lightgbm as lgb
6
5
  from sklearn.ensemble import HistGradientBoostingClassifier, HistGradientBoostingRegressor
@@ -8,6 +7,7 @@ from sklearn.base import ClassifierMixin
8
7
  from typing import Literal, Union, Tuple, Dict, Optional
9
8
  import polars as pl
10
9
  from functools import partial
10
+ from copy import deepcopy
11
11
  from .utilities import sanitize_filename, _script_info, threshold_binary_values, deserialize_object, list_files_by_extension
12
12
 
13
13
 
@@ -210,18 +210,25 @@ def run_pso(lower_boundaries: list[float],
210
210
  -----
211
211
  - PSO minimizes the objective function by default; if maximization is desired, it should be handled inside the ObjectiveFunction.
212
212
  """
213
+ # set local deep copies to prevent in place list modification
214
+ local_lower_boundaries = deepcopy(lower_boundaries)
215
+ local_upper_boundaries = deepcopy(upper_boundaries)
216
+
213
217
  # Append binary boundaries
214
218
  binary_number = objective_function.binary_features
215
219
  if auto_binary_boundaries and binary_number > 0:
216
- lower_boundaries.extend([0] * binary_number)
217
- upper_boundaries.extend([1] * binary_number)
220
+ local_lower_boundaries.extend([0] * binary_number)
221
+ local_upper_boundaries.extend([1] * binary_number)
222
+
223
+ # Set the total length of features
224
+ size_of_features = len(local_lower_boundaries)
218
225
 
219
- lower, upper = _set_boundaries(lower_boundaries, upper_boundaries)
226
+ lower, upper = _set_boundaries(local_lower_boundaries, local_upper_boundaries)
220
227
 
221
228
  # feature names
222
229
  if feature_names is None and objective_function.feature_names is not None:
223
230
  feature_names = objective_function.feature_names
224
- names = _set_feature_names(size=len(lower_boundaries), names=feature_names)
231
+ names = _set_feature_names(size=size_of_features, names=feature_names)
225
232
 
226
233
  # target name
227
234
  if target_name is None and objective_function.target_name is not None:
@@ -263,7 +270,7 @@ def run_pso(lower_boundaries: list[float],
263
270
  return best_features_named, best_target_named
264
271
  else:
265
272
  all_best_targets = list()
266
- all_best_features = [[] for _ in range(len(lower_boundaries))]
273
+ all_best_features = [[] for _ in range(size_of_features)]
267
274
  for _ in range(post_hoc_analysis):
268
275
  best_features, best_target, *_ = _pso(**arguments)
269
276
  # best_features, best_target, _particle_positions, _target_values_per_position = _pso(**arguments)
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "dragon-ml-toolbox"
3
- version = "1.4.6"
3
+ version = "1.4.8"
4
4
  description = "A collection of tools for data science and machine learning projects"
5
5
  authors = [
6
6
  { name = "Karl Loza", email = "luigiloza@gmail.com" }