Learn R Programming

synthesizer (version 0.4.0)

pmse: Compute the pMSE metric between synthetic and real data

Description

The propensity mean squared error is defined as \(\frac{1}{N}\sum_{i=1}^N(p_i-c)^2\), where \(c\) is the number of synthetic records, divided by the sum of the number of synthetic and real records.

Usage

pmse(synth, real, model = c("lr", "rf"), nrep = NULL)

Value

[numeric] scalar.

Arguments

synth

[data.frame] Synthesized data.

real

[real] Data to compare with the synthesized data.

model

[character] Model used to compute propensity scores. Options are "lr": logistic regression, and "rf": random forest.

nrep

[integer] Number of model repetitions to average the pMSE value over. Ignored for lr.

Examples

Run this code
scars <- synthesize(cars)
pmse(scars, cars)

Run the code above in your browser using DataLab