dragon-ml-toolbox 5.0.0__tar.gz → 5.1.0__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-5.0.0/dragon_ml_toolbox.egg-info → dragon_ml_toolbox-5.1.0}/PKG-INFO +2 -2
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/README.md +1 -1
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0/dragon_ml_toolbox.egg-info}/PKG-INFO +2 -2
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ML_datasetmaster.py +91 -1
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/pyproject.toml +1 -1
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/LICENSE +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/LICENSE-THIRD-PARTY.md +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/dragon_ml_toolbox.egg-info/SOURCES.txt +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/dragon_ml_toolbox.egg-info/dependency_links.txt +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/dragon_ml_toolbox.egg-info/requires.txt +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/dragon_ml_toolbox.egg-info/top_level.txt +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ETL_engineering.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/GUI_tools.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/MICE_imputation.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ML_callbacks.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ML_evaluation.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ML_inference.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ML_optimization.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ML_trainer.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/PSO_optimization.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/RNN_forecast.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/SQL.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/VIF_factor.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/__init__.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/_logger.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/_pytorch_models.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/_script_info.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/custom_logger.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/data_exploration.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ensemble_inference.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/ensemble_learning.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/handle_excel.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/keys.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/optimization_tools.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/path_manager.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/ml_tools/utilities.py +0 -0
- {dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dragon-ml-toolbox
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.1.0
|
|
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
|
|
@@ -268,5 +268,5 @@ After installation, import modules like this:
|
|
|
268
268
|
|
|
269
269
|
```python
|
|
270
270
|
from ml_tools.utilities import serialize_object, deserialize_object
|
|
271
|
-
from ml_tools
|
|
271
|
+
from ml_tools import custom_logger
|
|
272
272
|
```
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dragon-ml-toolbox
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.1.0
|
|
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
|
|
@@ -268,5 +268,5 @@ After installation, import modules like this:
|
|
|
268
268
|
|
|
269
269
|
```python
|
|
270
270
|
from ml_tools.utilities import serialize_object, deserialize_object
|
|
271
|
-
from ml_tools
|
|
271
|
+
from ml_tools import custom_logger
|
|
272
272
|
```
|
|
@@ -21,6 +21,7 @@ from ._script_info import _script_info
|
|
|
21
21
|
# --- public-facing API ---
|
|
22
22
|
__all__ = [
|
|
23
23
|
"DatasetMaker",
|
|
24
|
+
"SimpleDatasetMaker",
|
|
24
25
|
"VisionDatasetMaker",
|
|
25
26
|
"SequenceMaker",
|
|
26
27
|
"ResizeAspectFill",
|
|
@@ -328,7 +329,7 @@ class DatasetMaker(_BaseMaker):
|
|
|
328
329
|
|
|
329
330
|
return self.scaler.inverse_transform(data_np)
|
|
330
331
|
|
|
331
|
-
def get_datasets(self) -> Tuple[
|
|
332
|
+
def get_datasets(self) -> Tuple[Dataset, Dataset]:
|
|
332
333
|
"""Primary method to get the final PyTorch Datasets."""
|
|
333
334
|
if not self._is_split:
|
|
334
335
|
raise RuntimeError("Data has not been split yet. Call .split_data() or .process() first.")
|
|
@@ -370,6 +371,95 @@ class DatasetMaker(_BaseMaker):
|
|
|
370
371
|
return pandas.DataFrame(full_tensor.numpy(), columns=new_columns, index=cat_df.index)
|
|
371
372
|
|
|
372
373
|
|
|
374
|
+
# Streamlined DatasetMaker version
|
|
375
|
+
class SimpleDatasetMaker:
|
|
376
|
+
"""
|
|
377
|
+
A simplified dataset maker for pre-processed, numerical pandas DataFrames.
|
|
378
|
+
|
|
379
|
+
This class takes a DataFrame, automatically splits it into training and
|
|
380
|
+
testing sets, and converts them into PyTorch Datasets. It assumes the
|
|
381
|
+
target variable is the last column.
|
|
382
|
+
|
|
383
|
+
Args:
|
|
384
|
+
pandas_df (pandas.DataFrame): The pre-processed input DataFrame with numerical data.
|
|
385
|
+
test_size (float): The proportion of the dataset to allocate to the
|
|
386
|
+
test split.
|
|
387
|
+
random_state (int): The seed for the random number generator for
|
|
388
|
+
reproducibility.
|
|
389
|
+
id (str | None): An optional object identifier.
|
|
390
|
+
"""
|
|
391
|
+
def __init__(self, pandas_df: pandas.DataFrame, test_size: float = 0.2, random_state: int = 42, id: Optional[str]=None):
|
|
392
|
+
"""
|
|
393
|
+
Attributes:
|
|
394
|
+
`train_dataset` -> PyTorch Dataset
|
|
395
|
+
`test_dataset` -> PyTorch Dataset
|
|
396
|
+
`feature_names` -> list[str]
|
|
397
|
+
`target_name` -> str
|
|
398
|
+
`id` -> str | None
|
|
399
|
+
"""
|
|
400
|
+
|
|
401
|
+
if not isinstance(pandas_df, pandas.DataFrame):
|
|
402
|
+
raise TypeError("Input must be a pandas.DataFrame.")
|
|
403
|
+
|
|
404
|
+
#set id
|
|
405
|
+
self._id = id
|
|
406
|
+
|
|
407
|
+
# 1. Identify features and target
|
|
408
|
+
features = pandas_df.iloc[:, :-1]
|
|
409
|
+
target = pandas_df.iloc[:, -1]
|
|
410
|
+
|
|
411
|
+
self._feature_names = features.columns.tolist()
|
|
412
|
+
self._target_name = target.name
|
|
413
|
+
|
|
414
|
+
# 2. Split the data
|
|
415
|
+
X_train, X_test, y_train, y_test = train_test_split(
|
|
416
|
+
features, target, test_size=test_size, random_state=random_state
|
|
417
|
+
)
|
|
418
|
+
|
|
419
|
+
self._X_train_shape = X_train.shape
|
|
420
|
+
self._X_test_shape = X_test.shape
|
|
421
|
+
self._y_train_shape = y_train.shape
|
|
422
|
+
self._y_test_shape = y_test.shape
|
|
423
|
+
|
|
424
|
+
# 3. Convert to PyTorch Datasets
|
|
425
|
+
self._train_ds = _PytorchDataset(X_train.values, y_train.values)
|
|
426
|
+
self._test_ds = _PytorchDataset(X_test.values, y_test.values)
|
|
427
|
+
|
|
428
|
+
@property
|
|
429
|
+
def train_dataset(self) -> Dataset:
|
|
430
|
+
"""Returns the training PyTorch dataset."""
|
|
431
|
+
return self._train_ds
|
|
432
|
+
|
|
433
|
+
@property
|
|
434
|
+
def test_dataset(self) -> Dataset:
|
|
435
|
+
"""Returns the testing PyTorch dataset."""
|
|
436
|
+
return self._test_ds
|
|
437
|
+
|
|
438
|
+
@property
|
|
439
|
+
def feature_names(self) -> list[str]:
|
|
440
|
+
"""Returns the list of feature column names."""
|
|
441
|
+
return self._feature_names
|
|
442
|
+
|
|
443
|
+
@property
|
|
444
|
+
def target_name(self) -> str:
|
|
445
|
+
"""Returns the name of the target column."""
|
|
446
|
+
return str(self._target_name)
|
|
447
|
+
|
|
448
|
+
@property
|
|
449
|
+
def id(self) -> Optional[str]:
|
|
450
|
+
"""Returns teh object identifier if any."""
|
|
451
|
+
return self._id
|
|
452
|
+
|
|
453
|
+
def dataframes_info(self) -> None:
|
|
454
|
+
"""Prints the shape information of the split pandas DataFrames."""
|
|
455
|
+
print("--- Original DataFrame Shapes After Split ---")
|
|
456
|
+
print(f" X_train shape: {self._X_train_shape}")
|
|
457
|
+
print(f" y_train shape: {self._y_train_shape}\n")
|
|
458
|
+
print(f" X_test shape: {self._X_test_shape}")
|
|
459
|
+
print(f" y_test shape: {self._y_test_shape}")
|
|
460
|
+
print("-------------------------------------------")
|
|
461
|
+
|
|
462
|
+
|
|
373
463
|
# --- VisionDatasetMaker ---
|
|
374
464
|
class VisionDatasetMaker(_BaseMaker):
|
|
375
465
|
"""
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/dragon_ml_toolbox.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{dragon_ml_toolbox-5.0.0 → dragon_ml_toolbox-5.1.0}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|