-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
DiagnosticReport
to calculate base correctness of synthetic …
…data (#496)
- Loading branch information
Showing
15 changed files
with
252 additions
and
854 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,19 @@ | ||
"""Multi table diagnostic report.""" | ||
from copy import deepcopy | ||
|
||
from sdmetrics.reports._results_handler import DiagnosticReportResultsHandler | ||
from sdmetrics.reports.multi_table._properties import Boundary, Coverage, Synthesis | ||
from sdmetrics.reports.multi_table._properties import DataValidity, RelationshipValidity, Structure | ||
from sdmetrics.reports.multi_table.base_multi_table_report import BaseMultiTableReport | ||
|
||
|
||
class DiagnosticReport(BaseMultiTableReport): | ||
"""Multi table diagnostic report. | ||
This class creates a diagnostic report for multi-table data. It calculates the diagnostic | ||
score along three properties - Synthesis, Coverage, and Boundary. | ||
score along three properties - Relationship Validity, Data Structure, and Data Validity. | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self._properties = { | ||
'Coverage': Coverage(), | ||
'Boundary': Boundary(), | ||
'Synthesis': Synthesis() | ||
'Data Validity': DataValidity(), | ||
'Data Structure': Structure(), | ||
'Relationship Validity': RelationshipValidity() | ||
} | ||
self._results_handler = DiagnosticReportResultsHandler() | ||
|
||
def _handle_results(self, verbose): | ||
self._results_handler.print_results(self._properties, verbose) | ||
|
||
def get_results(self): | ||
"""Return the diagnostic results. | ||
Returns: | ||
dict | ||
The diagnostic results. | ||
""" | ||
self._check_report_generated() | ||
return deepcopy(self._results_handler.results) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,18 @@ | ||
"""Single table diagnostic report.""" | ||
import logging | ||
from copy import deepcopy | ||
|
||
from sdmetrics.reports._results_handler import DiagnosticReportResultsHandler | ||
from sdmetrics.reports.base_report import BaseReport | ||
from sdmetrics.reports.single_table._properties import Boundary, Coverage, Synthesis | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
from sdmetrics.reports.single_table._properties import DataValidity, Structure | ||
|
||
|
||
class DiagnosticReport(BaseReport): | ||
"""Single table diagnostic report. | ||
This class creates a diagnostic report for single-table data. It calculates the diagnostic | ||
score along three properties - Synthesis, Coverage, and Boundary. | ||
score along two properties - Data Structure and Data Validity. | ||
""" | ||
|
||
def __init__(self): | ||
super().__init__() | ||
self._properties = { | ||
'Coverage': Coverage(), | ||
'Boundary': Boundary(), | ||
'Synthesis': Synthesis() | ||
'Data Validity': DataValidity(), | ||
'Data Structure': Structure(), | ||
} | ||
self._results_handler = DiagnosticReportResultsHandler() | ||
|
||
def _handle_results(self, verbose): | ||
self._results_handler.print_results(self._properties, verbose) | ||
|
||
def get_results(self): | ||
"""Return the diagnostic results. | ||
Returns: | ||
dict | ||
The diagnostic results. | ||
""" | ||
self._check_report_generated() | ||
return deepcopy(self._results_handler.results) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.