Skip to content

Commit d05ef78

Browse files
authored
Merge pull request #67 from NGO-Algorithm-Audit/feature/ui-text-9
Feature/UI text 9 en 8
2 parents e48e8a2 + 3bcbf0b commit d05ef78

File tree

3 files changed

+35
-10
lines changed

3 files changed

+35
-10
lines changed

src/assets/synthetic-data.tsx

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,12 +386,23 @@ def run():
386386
'reportType': 'table',
387387
'titleKey': 'syntheticData.efficacyMetricsTitle',
388388
'showIndex' : False,
389+
'preContent' : [{
390+
'contentType': 'text',
391+
'textKey': 'syntheticData.efficacyMetricsDescription'
392+
}],
389393
'data': metrics_df.to_json(orient="records"),
390394
},
391395
{
392396
'reportType': 'table',
393397
'titleKey': 'syntheticData.disclosureProtectionTitle',
394398
'showIndex' : False,
399+
'preContent' : [{
400+
'contentType': 'text',
401+
'textKey': 'syntheticData.disclosureProtectionDescription'
402+
},{
403+
'contentType': 'text',
404+
'text': f"Score: {dp_score:.3f}"
405+
}],
395406
'data': dp_report_df.to_json(orient="records"),
396407
}
397408
]

src/components/DistributionReport.tsx

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ function countCategory2ForCategory1(
5959
type additionalContent = {
6060
contentType: string;
6161
textKey?: string;
62+
text?: string;
6263
params?: Record<string, string | number | boolean>;
6364
}[];
6465

@@ -161,11 +162,12 @@ export const DistributionReport = (
161162
key={index}
162163
className="-mt-2 text-gray-800 markdown"
163164
>
164-
{t(
165-
content.textKey ??
166-
'',
167-
content.params
168-
)}
165+
{content.text ??
166+
t(
167+
content.textKey ??
168+
'',
169+
content.params
170+
)}
169171
</MarkdownWithTooltips>
170172
);
171173
}
@@ -190,11 +192,12 @@ export const DistributionReport = (
190192
key={index}
191193
className="-mt-2 text-gray-800 markdown"
192194
>
193-
{t(
194-
content.textKey ??
195-
'',
196-
content.params
197-
)}
195+
{content.text ??
196+
t(
197+
content.textKey ??
198+
'',
199+
content.params
200+
)}
198201
</MarkdownWithTooltips>
199202
);
200203
} else if (

src/locales/en.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,18 @@ For categorical (or boolean) columns the following metrics are computed:
188188
correlationMatrixDescription: `The matrix below illustrates the differences in pairwise correlations between variables in the original and synthetic data.
189189
Green cells signify that the pairwise correlation was accurately captured, with 0 representing the best possible score. Red cells indicate poor capture of the pairwise correlation.`,
190190
efficacyMetricsTitle: 'Efficacy metrics',
191+
efficacyMetricsDescription: `Efficacy metrics comparing real and synthetic datasets for downstream predictive tasks. The idea is to train a predictive model on synthetic data and evaluate its performance on real data. The type of metrics computed depends on the task:
192+
193+
For regression (when the target is numerical):
194+
- Mean Squared Error (MSE)
195+
- Mean Absolute Error (MAE)
196+
- R^2 Score
197+
198+
For classification (when the target is categorical/boolean):
199+
- Accuracy Score
200+
- Weighted F1 Score`,
191201
disclosureProtectionTitle: 'Privacy metrics',
202+
disclosureProtectionDescription: `A class to compute the disclosure protection metric for synthetic data. This metric measures the proportion of synthetic records that are too similar (within a defined threshold) to real records, posing a disclosure risk.`,
192203
outputDataTitle: '5. Generated synthetic data',
193204
moreInfoTitle: '6. More information',
194205
correlationDifference:

0 commit comments

Comments
 (0)