sep.plot <- function(prob = 'Propensity',
y = 't_Paid',
df_train = ds1,
df_test = ds2) {
require(separationplot)
df_train <- as.data.frame(df_train)
separationplot(df_train[, prob], df_train[, y], newplot = F,
heading = "Separation Plot - Train", xlab = "Probabilty Spectrum",
type = 'rect')
if (!is.null(df_test)) {
df_test <- as.data.frame(df_test)
separationplot(df_test[, prob], df_test[, y], newplot = F,
heading = "Separation Plot - Test", xlab = "Probabilty Spectrum",
type = 'rect')
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.