R/sep.plot_Function.R

Defines functions sep.plot

Documented in sep.plot

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')  
  }
  
}
Ehsan-F/R-Mixtape documentation built on June 24, 2020, 12:22 a.m.