Skip to content

Commit 2e0efd6

Browse files
committed
Fix flake8 CI errors
1 parent dff20f4 commit 2e0efd6

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

pycanon/report/pdf_utility_report.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,7 @@ def get_pdf_utility_report(
7575
gen=True,
7676
file_pdf="utility_report.pdf",
7777
) -> None:
78-
"""Generate the PDF report both with the utility metrics obtained and the
79-
anonymity parameters.
78+
"""Generate the PDF report both with the utility and anonymity checks.
8079
8180
:param data_raw: dataframe with the data raw under study.
8281
:type data_raw: pandas dataframe

pycanon/utility/utility_metrics.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ def average_ecsize(
2727
quasi_ident: typing.Union[typing.List, np.ndarray],
2828
sup=True,
2929
) -> float:
30-
"""Calculate the metric average equivalence class size. Two scenarios are allowed
31-
depending on whether any records from the original database have been deleted.
30+
"""Calculate the metric average equivalence class size.
3231
3332
:param data_raw: dataframe with the data raw under study.
3433
:type data_raw: pandas dataframe
@@ -41,7 +40,7 @@ def average_ecsize(
4140
:type quasi_ident: list of strings
4241
4342
:param sup: boolean, default to True. If true, suppression has been applied to the
44-
original dataset (somo records may have been deleted)-
43+
original dataset (somo records may have been deleted).
4544
:type sup: boolean
4645
"""
4746
equiv_class = aux_anonymity.get_equiv_class(data_anon, quasi_ident)
@@ -57,8 +56,7 @@ def classification_metric(
5756
quasi_ident: typing.Union[typing.List, np.ndarray],
5857
sens_att: typing.Union[typing.List, np.ndarray],
5958
) -> float:
60-
"""Calculate the classification metric according to the original (raw)
61-
and anonymized datasets.
59+
"""Calculate the classification metric.
6260
6361
:param data_raw: dataframe with the data raw under study.
6462
:type data_raw: pandas dataframe
@@ -90,14 +88,14 @@ def discernability_metric(
9088
data_anon: pd.DataFrame,
9189
quasi_ident: typing.Union[typing.List, np.ndarray],
9290
) -> float:
93-
"""Calculate the discernability metric, assuming that all the equivalence classes
94-
have more than k records, and given each suppressed record a penalty of the size
95-
of the input dataset.
91+
"""Calculate the discernability metric.
9692
9793
:param data_raw: dataframe with the data raw under study.
9894
:type data_raw: pandas dataframe
9995
100-
:param data_anon: dataframe with the data anonymized.
96+
:param data_anon: dataframe with the data anonymized. Assuming that all the
97+
equivalence classes have more than k records, and given each suppressed record
98+
a penalty of the size of the input dataset.
10199
:type data_anon: pandas dataframe
102100
103101
:param quasi_ident: list with the name of the columns of the dataframe

0 commit comments

Comments
 (0)