plot_compared_sdg: Plot the distribution of a varaible from the synthetic data...

Description Usage Arguments Value Examples

View source: R/compare_sdg.R

Description

plot_compared_sdg return a plot of the comparision of the distribution of synthetic data vs real data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
plot_compared_sdg(
  target_var,
  training_set,
  syn_data_names,
  generated_data1,
  generated_data2 = NA,
  generated_data3 = NA,
  generated_data4 = NA,
  generated_data5 = NA,
  generated_data6 = NA
)

Arguments

target_var

A string of the comparision variable name.

training_set

A data frame of the training data.

syn_data_names

A string vector of names of the generators.

generated_data1

A data frame of synthetic data 1.

generated_data2

A data frame of synthetic data 2.

generated_data3

A data frame of synthetic data 3.

generated_data4

A data frame of synthetic data 4.

generated_data5

A data frame of synthetic data 5.

generated_data6

A data frame of synthetic data 6.

Value

The output is a plot of the comparision of the distribution of synthetic data vs real data. If the target_var is discrete, the plot is a bar plot, If the target_var is continous, the plot is a density plot,

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
adult_data <- split_data(adult[1:100,], 70)
bn_learn <- gen_bn_learn(adult_data$training_set, "hc")
plot_compared_sdg(target_var = "age",
    training_set = adult_data$training_set,
    syn_data_names = c("bn_learn"),
    generated_data1 = bn_learn$gen_data)
plot_compared_sdg(target_var = "race",
    training_set = adult_data$training_set,
    syn_data_names = c("bn_learn"),
    generated_data1 = bn_learn$gen_data)

sdglinkage documentation built on April 27, 2020, 5:09 p.m.