powered by
compare_synthetic() evaluates the fidelity, utility and disclosure risk of a synthetic data set in one call:
compare_synthetic()
marginal: marginal_metrics() per variable;
marginal_metrics()
association: association_matrix() of both data sets and their difference;
association_matrix()
utility: pmse() and cross-validated discriminator_auc();
pmse()
discriminator_auc()
privacy: dcr() distance to closest record.
dcr()
The result has print(), summary(), plot() and ggplot2::autoplot() methods.
print()
summary()
plot()
ggplot2::autoplot()
compare_synthetic( real, synthetic, vars = NULL, metrics = c("marginal", "association", "utility", "privacy"), max_rows = 5000L, seed = NULL )
An object of class sp_comparison.
sp_comparison
Data frames (or objects coercible to data frames) with common columns.
Optional subset of variables.
Which groups of metrics to compute.
Maximum rows per data set for the classifier and distance computations.
Optional random seed.
syn <- synthesize(iris, seed = 1) cmp <- compare_synthetic(iris, syn, seed = 1) cmp plot(cmp, type = "association")
Run the code above in your browser using DataLab