| readData | R Documentation |
Read the original input datasets to be learned for synthetic data generation. The package allows the input data to have missing values and impute them with the posterior predictive distribution, so no missing values exist in the synthetic data output.
readData(Y_input, X_input, RandomSeed = 99)
## S3 method for class 'readData_passed'
print(x, ...)
Y_input |
data.frame consisting of continuous variables of the original data.
It must contain only variables of class |
X_input |
data.frame consisting of categorical variables of the original data.
It must contain only variables of class |
RandomSeed |
random seed number. |
x |
object of class |
... |
further arguments passed to or from other methods. |
readData returns an object of "readData_passed" class.
An object of class "readData_passed" is a list containing the following components:
n_sample |
number of records in the input dataset. |
p_Y |
number of continuous variables. |
Y_mat_std |
matrix with standardized values of |
mean_Y_input |
mean vectors of original |
sd_Y_input |
standard deviation vectors of original |
NA_Y_mat |
matrix indicating missing values in |
p_X |
number of categorical variables. |
D_l_vec |
numbers of levels of each categorical variable. |
X_mat_std |
matrix with the numeric-transformed values of |
levels_X_input |
list of levels of each categorical variable. |
NA_X_mat |
matrix indicating missing values in |
var_names |
list containing variable names of |
orig_data |
original dataset. |
multipleSyn, createModel
## Example data: split into continuous (Y_input) and categorical (X_input)
### Continuous variables (numeric only)
Y_demo <- data.frame(
Sepal.Length = iris$Sepal.Length,
Sepal.Width = iris$Sepal.Width,
Petal.Length = iris$Petal.Length,
Petal.Width = iris$Petal.Width
)
### Categorical variables (factor)
X_demo_char <- data.frame(
Species = as.character(iris$Species)
)
## Not run:
## This will produce an error because X_input is not a factor:
# readData(Y_input = Y_demo, X_input = X_demo_char)
## End(Not run)
## Proper conversion of X_input to factor:
X_demo <- data.frame(
Species = factor(iris$Species)
)
dat_obj <- readData(Y_input = Y_demo, X_input = X_demo)
print(dat_obj)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.