title: “Automated Model Development Process”
author: “Fan Dongping”
date: “2019-09-13”
output: rmarkdown::html_vignette
vignette: >
%
%
%
library(creditmodel)
if (!dir.exists("c:/test_model")) dir.create("c:/test_model")
setwd("c:/test_model")
sub = cv_split(UCICreditCard, k = 3)[[1]]
dat = UCICreditCard[sub,]
dat = re_name(dat, "default.payment.next.month", "target")
dat = data_cleansing(dat, target = "target", obs_id = "ID",
occur_time = "apply_date", miss_values = list("", -1, -2))
train_test <- train_test_split(dat, split_type = "OOT", prop = 0.7,occur_time = "apply_date")
dat_train = train_test$train
dat_test = train_test$test
x_list = c("PAY_0", "LIMIT_BAL", "PAY_AMT5", "PAY_3")
B_model = training_model(dat = dat,
model_name = "UCICreditCard", target = "target", x_list = x_list,
occur_time = "apply_date", obs_id = "ID", dat_test = dat_test,
preproc = FALSE,
feature_filter = NULL,
algorithm = list("RF","LR","XGB","GBM"),
LR.params = lr_params(lasso = TRUE,
step_wise = TRUE, vars_plot = TRUE),
XGB.params = xgb_params(),
breaks_list = NULL,
parallel = FALSE, cores_num = NULL,
save_pmml = FALSE, plot_show = FALSE,
model_path = getwd(),
seed = 46)
}