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.
- {dragon_ml_toolbox-1.4.6/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-1.4.8}/PKG-INFO +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8/dragon_ml_toolbox.egg-info}/PKG-INFO +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/MICE_imputation.py +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/data_exploration.py +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/ensemble_learning.py +0 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/handle_excel.py +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/logger.py +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/particle_swarm_optimization.py +13 -6
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/pyproject.toml +1 -1
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/LICENSE +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/LICENSE-THIRD-PARTY.md +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/README.md +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/VIF_factor.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/__init__.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/datasetmaster.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/pytorch_models.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/trainer.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/utilities.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/ml_tools/vision_helpers.py +0 -0
- {dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/setup.cfg +0 -0
|
@@ -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
|
|
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
|
|
|
@@ -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
|
-
|
|
217
|
-
|
|
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(
|
|
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=
|
|
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(
|
|
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)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/dragon_ml_toolbox.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-1.4.6 → dragon_ml_toolbox-1.4.8}/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
|