sdv 1.37.3.dev0__tar.gz → 1.37.4.dev0__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.
- {sdv-1.37.3.dev0/sdv.egg-info → sdv-1.37.4.dev0}/PKG-INFO +2 -2
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/pyproject.toml +2 -2
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/__init__.py +1 -1
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/datasets/demo.py +50 -9
- sdv-1.37.4.dev0/sdv/evaluation/__init__.py +12 -0
- sdv-1.37.4.dev0/sdv/evaluation/evaluation.py +102 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/evaluation/multi_table.py +31 -2
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/evaluation/single_table.py +30 -2
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0/sdv.egg-info}/PKG-INFO +2 -2
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv.egg-info/SOURCES.txt +1 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv.egg-info/requires.txt +1 -1
- sdv-1.37.3.dev0/sdv/evaluation/__init__.py +0 -1
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/LICENSE +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/README.md +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/_utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/_errors.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/_utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/base.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/fixed_combinations.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/fixed_increments.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/inequality.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/one_hot_encoding.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/programmable_constraint.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/cag/range.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/constraints/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/constraints/base.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/constraints/errors.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/constraints/tabular.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/constraints/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/data_processing/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/data_processing/data_processor.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/data_processing/datetime_formatter.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/data_processing/errors.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/data_processing/numerical_formatter.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/data_processing/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/datasets/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/datasets/local.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/errors.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/evaluation/_utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/io/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/io/local/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/io/local/local.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/lite/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/lite/single_table.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/logging/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/logging/logger.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/logging/sdv_logger_config.yml +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/logging/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/errors.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/metadata.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/metadata_upgrader.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/multi_table.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/single_table.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metadata/visualization.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metrics/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metrics/demos.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metrics/relational.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metrics/tabular.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/metrics/timeseries.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/multi_table/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/multi_table/base.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/multi_table/dayz.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/multi_table/hma.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/multi_table/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/sampling/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/sampling/hierarchical_sampler.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/sampling/independent_sampler.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/sampling/tabular.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/sequential/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/sequential/par.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/base.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/copulagan.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/copulas.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/ctgan.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/dayz.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/single_table/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/utils/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/utils/mixins.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/utils/poc.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/utils/utils.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv/version/__init__.py +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv.egg-info/dependency_links.txt +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv.egg-info/entry_points.txt +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/sdv.egg-info/top_level.txt +0 -0
- {sdv-1.37.3.dev0 → sdv-1.37.4.dev0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sdv
|
|
3
|
-
Version: 1.37.
|
|
3
|
+
Version: 1.37.4.dev0
|
|
4
4
|
Summary: Generate synthetic data for single table, multi table and sequential data
|
|
5
5
|
Author-email: "DataCebo, Inc." <info@sdv.dev>
|
|
6
6
|
License-Expression: BUSL-1.1
|
|
@@ -48,7 +48,7 @@ Requires-Dist: deepecho>=0.7.0; python_version < "3.14"
|
|
|
48
48
|
Requires-Dist: deepecho>=0.8.0; python_version >= "3.14"
|
|
49
49
|
Requires-Dist: rdt>=1.18.2; python_version < "3.14"
|
|
50
50
|
Requires-Dist: rdt>=1.20.0; python_version >= "3.14"
|
|
51
|
-
Requires-Dist: sdmetrics>=0.28.
|
|
51
|
+
Requires-Dist: sdmetrics>=0.28.1
|
|
52
52
|
Requires-Dist: platformdirs>=4.0
|
|
53
53
|
Requires-Dist: pyyaml>=6.0.1
|
|
54
54
|
Provides-Extra: excel
|
|
@@ -46,7 +46,7 @@ dependencies = [
|
|
|
46
46
|
"deepecho>=0.8.0;python_version>='3.14'",
|
|
47
47
|
"rdt>=1.18.2;python_version<'3.14'",
|
|
48
48
|
"rdt>=1.20.0;python_version>='3.14'",
|
|
49
|
-
"sdmetrics>=0.28.
|
|
49
|
+
"sdmetrics>=0.28.1",
|
|
50
50
|
'platformdirs>=4.0',
|
|
51
51
|
'pyyaml>=6.0.1',
|
|
52
52
|
]
|
|
@@ -149,7 +149,7 @@ namespaces = false
|
|
|
149
149
|
version = {attr = 'sdv.__version__'}
|
|
150
150
|
|
|
151
151
|
[tool.bumpversion]
|
|
152
|
-
current_version = "1.37.
|
|
152
|
+
current_version = "1.37.4.dev0"
|
|
153
153
|
parse = '(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<candidate>\d+))?'
|
|
154
154
|
serialize = [
|
|
155
155
|
'{major}.{minor}.{patch}.{release}{candidate}',
|
|
@@ -640,6 +640,20 @@ def _find_text_key(contents, dataset_prefix, filename):
|
|
|
640
640
|
return None
|
|
641
641
|
|
|
642
642
|
|
|
643
|
+
def _validate_resource_filepath(resource_filepath):
|
|
644
|
+
"""Validate a resource filepath is a string, not undefined and does not begin with slash."""
|
|
645
|
+
if not isinstance(resource_filepath, str):
|
|
646
|
+
raise TypeError('`resource_filepath` must be a string.')
|
|
647
|
+
|
|
648
|
+
if not resource_filepath:
|
|
649
|
+
raise ValueError('`resource_filepath` cannot be empty.')
|
|
650
|
+
|
|
651
|
+
if resource_filepath.startswith('/'):
|
|
652
|
+
raise ValueError(
|
|
653
|
+
"`resource_filepath` must be relative to the dataset and cannot begin with '/'."
|
|
654
|
+
)
|
|
655
|
+
|
|
656
|
+
|
|
643
657
|
def _validate_text_file_content(modality, output_filepath, filename):
|
|
644
658
|
"""Validation for the text file content method."""
|
|
645
659
|
_validate_modalities(modality)
|
|
@@ -750,7 +764,7 @@ def _save_file_content(
|
|
|
750
764
|
dataset_name (str):
|
|
751
765
|
The name of the dataset.
|
|
752
766
|
filename (str):
|
|
753
|
-
The filename to fetch (``'README.txt'`` or ``'SOURCE.txt'``).
|
|
767
|
+
The filename to fetch (``'README.txt'`` or ``'SOURCE.txt'`, ``'schemas/postgre.sql'``).
|
|
754
768
|
output_filepath (str):
|
|
755
769
|
Save the file contents at this path.
|
|
756
770
|
bucket (str):
|
|
@@ -860,10 +874,11 @@ def get_readme(
|
|
|
860
874
|
def save_resource(
|
|
861
875
|
modality,
|
|
862
876
|
dataset_name,
|
|
863
|
-
|
|
864
|
-
output_filepath,
|
|
877
|
+
resource_filepath=None,
|
|
878
|
+
output_filepath=None,
|
|
865
879
|
s3_bucket_name='sdv-datasets-public',
|
|
866
880
|
credentials=None,
|
|
881
|
+
resource_filename=None,
|
|
867
882
|
):
|
|
868
883
|
"""Save the resource to disk.
|
|
869
884
|
|
|
@@ -871,11 +886,12 @@ def save_resource(
|
|
|
871
886
|
modality (str):
|
|
872
887
|
The modality of the dataset: ``'single_table'``, ``'multi_table'``, ``'sequential'``.
|
|
873
888
|
dataset_name (str):
|
|
874
|
-
The name of the dataset to get the
|
|
875
|
-
|
|
876
|
-
The
|
|
877
|
-
|
|
878
|
-
|
|
889
|
+
The name of the dataset to get the resource for.
|
|
890
|
+
resource_filepath (str):
|
|
891
|
+
The location of the file to download from S3. This can be a filename or a filepath.
|
|
892
|
+
The location of the file should be under the dataset.
|
|
893
|
+
output_filepath (str):
|
|
894
|
+
The filepath where the resource should be saved.
|
|
879
895
|
s3_bucket_name (str, optional):
|
|
880
896
|
The name of the bucket to download from. Only 'sdv-datasets-public' is supported in
|
|
881
897
|
SDV Community. SDV Enterprise is required for other buckets. Defaults to
|
|
@@ -887,11 +903,36 @@ def save_resource(
|
|
|
887
903
|
'license_key': '<MY_LICENSE_KEY>'
|
|
888
904
|
}
|
|
889
905
|
Defaults to None.
|
|
906
|
+
resource_filename (str, optional):
|
|
907
|
+
**Deprecated.**
|
|
908
|
+
The name of the file to download from S3. Use
|
|
909
|
+
``resource_filepath`` instead. Defaults to None.
|
|
890
910
|
"""
|
|
911
|
+
if resource_filepath is None and resource_filename is None:
|
|
912
|
+
raise ValueError('Please provide a `resource_filepath`.')
|
|
913
|
+
|
|
914
|
+
if output_filepath is None:
|
|
915
|
+
raise ValueError('Please provide an `output_filepath`.')
|
|
916
|
+
|
|
917
|
+
if resource_filepath and resource_filename:
|
|
918
|
+
raise ValueError(
|
|
919
|
+
'Cannot use both `resource_filepath` and `resource_filename`. '
|
|
920
|
+
'Please use only `resource_filepath`.'
|
|
921
|
+
)
|
|
922
|
+
|
|
923
|
+
if resource_filename is not None:
|
|
924
|
+
deprecation_msg = (
|
|
925
|
+
'Warning: The `resource_filename` parameter is deprecated. '
|
|
926
|
+
'Please use the `resource_filepath` parameter instead.'
|
|
927
|
+
)
|
|
928
|
+
warnings.warn(deprecation_msg, FutureWarning)
|
|
929
|
+
resource_filepath = resource_filename
|
|
930
|
+
|
|
931
|
+
_validate_resource_filepath(resource_filepath)
|
|
891
932
|
_save_file_content(
|
|
892
933
|
modality=modality,
|
|
893
934
|
dataset_name=dataset_name,
|
|
894
|
-
filename=
|
|
935
|
+
filename=resource_filepath,
|
|
895
936
|
output_filepath=output_filepath,
|
|
896
937
|
bucket=s3_bucket_name,
|
|
897
938
|
credentials=credentials,
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"""Methods to compare the real and synthetic data."""
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
from sdmetrics.reports import DiagnosticReport, QualityReport
|
|
5
|
+
|
|
6
|
+
from sdv.metadata.metadata import Metadata
|
|
7
|
+
|
|
8
|
+
DEFAULT_SINGLE_TABLE_NAME = 'table'
|
|
9
|
+
ALLOWED_TYPES = (pd.DataFrame, dict)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _validate_data_type(data, argument_name):
|
|
13
|
+
if not isinstance(data, ALLOWED_TYPES):
|
|
14
|
+
raise TypeError(
|
|
15
|
+
f'{argument_name} must be a pandas DataFrame or dictionary, got {type(data).__name__}.'
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _validate_data(real_data, synthetic_data):
|
|
20
|
+
_validate_data_type(real_data, 'real_data')
|
|
21
|
+
_validate_data_type(synthetic_data, 'synthetic_data')
|
|
22
|
+
|
|
23
|
+
if type(real_data) is not type(synthetic_data):
|
|
24
|
+
raise TypeError(
|
|
25
|
+
'real_data and synthetic_data must have the same type. '
|
|
26
|
+
f'Got {type(real_data).__name__} and '
|
|
27
|
+
f'{type(synthetic_data).__name__}.'
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
def _handle_single_table(real_data, synthetic_data, metadata):
|
|
32
|
+
if isinstance(real_data, pd.DataFrame) and isinstance(synthetic_data, pd.DataFrame):
|
|
33
|
+
table_name = DEFAULT_SINGLE_TABLE_NAME
|
|
34
|
+
if isinstance(metadata, Metadata):
|
|
35
|
+
table_name = metadata._get_single_table_name() or table_name
|
|
36
|
+
else:
|
|
37
|
+
metadata = Metadata.load_from_dict(
|
|
38
|
+
metadata.to_dict(), single_table_name=DEFAULT_SINGLE_TABLE_NAME
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
real_data = {table_name: real_data}
|
|
42
|
+
synthetic_data = {table_name: synthetic_data}
|
|
43
|
+
|
|
44
|
+
return real_data, synthetic_data, metadata
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def evaluate_quality(real_data, synthetic_data, metadata, verbose=True):
|
|
48
|
+
"""Evaluate the quality of the synthetic data.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
real_data (pd.DataFrame):
|
|
52
|
+
The table containing the real data.
|
|
53
|
+
synthetic_data (pd.DataFrame):
|
|
54
|
+
The table containing the synthetic data.
|
|
55
|
+
metadata (Metadata):
|
|
56
|
+
The metadata object describing the real/synthetic data.
|
|
57
|
+
verbose (bool):
|
|
58
|
+
Whether or not to print report summary and progress.
|
|
59
|
+
Defaults to True.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
QualityReport:
|
|
63
|
+
Single table quality report object.
|
|
64
|
+
"""
|
|
65
|
+
_validate_data(real_data, synthetic_data)
|
|
66
|
+
real_data, synthetic_data, metadata = _handle_single_table(
|
|
67
|
+
real_data=real_data,
|
|
68
|
+
synthetic_data=synthetic_data,
|
|
69
|
+
metadata=metadata,
|
|
70
|
+
)
|
|
71
|
+
quality_report = QualityReport()
|
|
72
|
+
quality_report.generate(real_data, synthetic_data, metadata.to_dict(), verbose)
|
|
73
|
+
return quality_report
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def run_diagnostic(real_data, synthetic_data, metadata, verbose=True):
|
|
77
|
+
"""Run diagnostic report for the synthetic data.
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
real_data (pd.DataFrame):
|
|
81
|
+
The table containing the real data.
|
|
82
|
+
synthetic_data (pd.DataFrame):
|
|
83
|
+
The table containing the synthetic data.
|
|
84
|
+
metadata (Metadata):
|
|
85
|
+
The metadata object describing the real/synthetic data.
|
|
86
|
+
verbose (bool):
|
|
87
|
+
Whether or not to print report summary and progress.
|
|
88
|
+
Defaults to True.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
DiagnosticReport:
|
|
92
|
+
Single table diagnostic report object.
|
|
93
|
+
"""
|
|
94
|
+
_validate_data(real_data, synthetic_data)
|
|
95
|
+
real_data, synthetic_data, metadata = _handle_single_table(
|
|
96
|
+
real_data=real_data,
|
|
97
|
+
synthetic_data=synthetic_data,
|
|
98
|
+
metadata=metadata,
|
|
99
|
+
)
|
|
100
|
+
diagnostic_report = DiagnosticReport()
|
|
101
|
+
diagnostic_report.generate(real_data, synthetic_data, metadata.to_dict(), verbose)
|
|
102
|
+
return diagnostic_report
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Methods to compare the real and synthetic data for multi-table."""
|
|
2
2
|
|
|
3
|
+
import warnings
|
|
4
|
+
|
|
3
5
|
from sdmetrics import visualization
|
|
4
6
|
from sdmetrics.reports.multi_table.diagnostic_report import DiagnosticReport
|
|
5
7
|
from sdmetrics.reports.multi_table.quality_report import QualityReport
|
|
@@ -7,7 +9,7 @@ from sdmetrics.reports.multi_table.quality_report import QualityReport
|
|
|
7
9
|
import sdv.evaluation.single_table as single_table_visualization
|
|
8
10
|
|
|
9
11
|
|
|
10
|
-
def
|
|
12
|
+
def _evaluate_quality(real_data, synthetic_data, metadata, verbose=True):
|
|
11
13
|
"""Evaluate the quality of the synthetic data.
|
|
12
14
|
|
|
13
15
|
Args:
|
|
@@ -30,7 +32,7 @@ def evaluate_quality(real_data, synthetic_data, metadata, verbose=True):
|
|
|
30
32
|
return quality_report
|
|
31
33
|
|
|
32
34
|
|
|
33
|
-
def
|
|
35
|
+
def _run_diagnostic(real_data, synthetic_data, metadata, verbose=True):
|
|
34
36
|
"""Run diagnostic report for the synthetic data.
|
|
35
37
|
|
|
36
38
|
Args:
|
|
@@ -172,3 +174,30 @@ def get_cardinality_plot(
|
|
|
172
174
|
parent_primary_key,
|
|
173
175
|
plot_type,
|
|
174
176
|
)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
DEPRECATED_EVALUATION_FUNCTIONS = {
|
|
180
|
+
'evaluate_quality': _evaluate_quality,
|
|
181
|
+
'run_diagnostic': _run_diagnostic,
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
PLOT_FUNCTIONS = {
|
|
185
|
+
'get_cardinality_plot': get_cardinality_plot,
|
|
186
|
+
'get_column_pair_plot': get_column_pair_plot,
|
|
187
|
+
'get_column_plot': get_column_plot,
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
def __getattr__(name):
|
|
192
|
+
if name in DEPRECATED_EVALUATION_FUNCTIONS:
|
|
193
|
+
warnings.warn(
|
|
194
|
+
"The evaluation functions are now accessible via the 'sdv.evaluation' module.",
|
|
195
|
+
FutureWarning,
|
|
196
|
+
stacklevel=2,
|
|
197
|
+
)
|
|
198
|
+
return DEPRECATED_EVALUATION_FUNCTIONS.get(name)
|
|
199
|
+
|
|
200
|
+
if name not in PLOT_FUNCTIONS:
|
|
201
|
+
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
|
|
202
|
+
|
|
203
|
+
return PLOT_FUNCTIONS.get(name)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Methods to compare the real and synthetic data for single-table."""
|
|
2
2
|
|
|
3
|
+
import warnings
|
|
4
|
+
|
|
3
5
|
from sdmetrics import visualization
|
|
4
6
|
from sdmetrics.reports.single_table.diagnostic_report import DiagnosticReport
|
|
5
7
|
from sdmetrics.reports.single_table.quality_report import QualityReport
|
|
@@ -9,7 +11,7 @@ from sdv.evaluation._utils import _prepare_data_visualization
|
|
|
9
11
|
from sdv.metadata.metadata import Metadata
|
|
10
12
|
|
|
11
13
|
|
|
12
|
-
def
|
|
14
|
+
def _evaluate_quality(real_data, synthetic_data, metadata, verbose=True):
|
|
13
15
|
"""Evaluate the quality of the synthetic data.
|
|
14
16
|
|
|
15
17
|
Args:
|
|
@@ -35,7 +37,7 @@ def evaluate_quality(real_data, synthetic_data, metadata, verbose=True):
|
|
|
35
37
|
return quality_report
|
|
36
38
|
|
|
37
39
|
|
|
38
|
-
def
|
|
40
|
+
def _run_diagnostic(real_data, synthetic_data, metadata, verbose=True):
|
|
39
41
|
"""Run diagnostic report for the synthetic data.
|
|
40
42
|
|
|
41
43
|
Args:
|
|
@@ -165,3 +167,29 @@ def get_column_pair_plot(
|
|
|
165
167
|
)
|
|
166
168
|
|
|
167
169
|
return visualization.get_column_pair_plot(real_data, synthetic_data, column_names, plot_type)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
DEPRECATED_EVALUATION_FUNCTIONS = {
|
|
173
|
+
'evaluate_quality': _evaluate_quality,
|
|
174
|
+
'run_diagnostic': _run_diagnostic,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
PLOT_FUNCTIONS = {
|
|
178
|
+
'get_column_pair_plot': get_column_pair_plot,
|
|
179
|
+
'get_column_plot': get_column_plot,
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
def __getattr__(name):
|
|
184
|
+
if name in DEPRECATED_EVALUATION_FUNCTIONS:
|
|
185
|
+
warnings.warn(
|
|
186
|
+
"The evaluation functions are now accessible via the 'sdv.evaluation' module.",
|
|
187
|
+
FutureWarning,
|
|
188
|
+
stacklevel=2,
|
|
189
|
+
)
|
|
190
|
+
return DEPRECATED_EVALUATION_FUNCTIONS.get(name)
|
|
191
|
+
|
|
192
|
+
if name not in PLOT_FUNCTIONS:
|
|
193
|
+
raise AttributeError(f'module {__name__!r} has no attribute {name!r}')
|
|
194
|
+
|
|
195
|
+
return PLOT_FUNCTIONS.get(name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: sdv
|
|
3
|
-
Version: 1.37.
|
|
3
|
+
Version: 1.37.4.dev0
|
|
4
4
|
Summary: Generate synthetic data for single table, multi table and sequential data
|
|
5
5
|
Author-email: "DataCebo, Inc." <info@sdv.dev>
|
|
6
6
|
License-Expression: BUSL-1.1
|
|
@@ -48,7 +48,7 @@ Requires-Dist: deepecho>=0.7.0; python_version < "3.14"
|
|
|
48
48
|
Requires-Dist: deepecho>=0.8.0; python_version >= "3.14"
|
|
49
49
|
Requires-Dist: rdt>=1.18.2; python_version < "3.14"
|
|
50
50
|
Requires-Dist: rdt>=1.20.0; python_version >= "3.14"
|
|
51
|
-
Requires-Dist: sdmetrics>=0.28.
|
|
51
|
+
Requires-Dist: sdmetrics>=0.28.1
|
|
52
52
|
Requires-Dist: platformdirs>=4.0
|
|
53
53
|
Requires-Dist: pyyaml>=6.0.1
|
|
54
54
|
Provides-Extra: excel
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"""Module to compare real and synthetic data."""
|
|
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
|
|
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
|
|
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
|