Learn R Programming

⚠️There's a newer version (1.3.1) of this package.Take me there.

creditmodel

creditmodel is a free and open source automated modeling R package designed to help model developers improve model development efficiency and enable many people with no background in data science to complete the modeling work in a short time.Let them focus more on the problem itself and allocate more time to decision-making.

creditmodel covers various tools such as data preprocessing, variable processing/derivation, variable screening/dimensionality reduction, modeling, data analysis, data visualization, model evaluation, strategy analysis, etc. It is a set of customized "core" tool kit for model developers.

creditmodel is suitable for machine learning automated modeling of classification targets, and is more suitable for the risk and marketing data of financial credit, e-commerce, and insurance with relatively high noise and low information content.

Installation

# install.packages("creditmodel")

Example

 # Automated Model Development Process


 if (!dir.exists("c:/test_model")) dir.create("c:/test_model")
 setwd("c:/test_model")
 library(creditmodel)
 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_train,
                         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 = FALSE),
                        XGB.params = xgb_params(),
                         breaks_list = NULL,
                        parallel = FALSE, cores_num = NULL,
                         save_pmml = FALSE, plot_show = FALSE,
                         model_path = getwd(),
                         seed = 46)

Copy Link

Version

Install

install.packages('creditmodel')

Monthly Downloads

543

Version

1.1.4

License

AGPL-3

Maintainer

Dongping Fan

Last Published

September 29th, 2019

Functions in creditmodel (1.1.4)

check_rules

check_rules
cohort_analysis

cohort_analysis cohort_function is for cohort(vintage) analysis.
de_percent

Recovery Percent Format
UCICreditCard

UCI Credit Card data
cohort_table_plot

cohort_table_plot cohort_table_plot is for ploting cohort(vintage) analysis table.
cor_heat_plot

Correlation Heat Plot
cv_split

Stratified Folds
cor_plot

Correlation Plot
cut_equal

Generating Initial Equal Size Sample Bins
get_auc_ks_lambda

get_auc_ks_lambda get_auc_ks_lambda is for get best lambda required in lasso_filter. This function required in lasso_filter
gbm_params

GBM Parameters
derived_partial_acf

derived_partial_acf
city_varieble_process

Processing of Address Variables
city_varieble

city_varieble
checking_data

Checking Data
data_cleansing

Data Cleaning
data_exploration

Data Exploration
get_iv_all

Calculate Information Value (IV) get_iv is used to calculate Information Value (IV) of an independent variable. get_iv_all can loop through IV for all specified independent variables.
entry_rate_na

Max Percent of Missing Value
customer_segmentation

Customer Segmentation
derived_pct

derived_pct
cos_sim

cos_sim
get_logistic_coef

get logistic coef
euclid_dist

euclid_dist
get_psi_plots

Plot PSI(Population Stability Index)
feature_select_wrapper

Feature Selection Wrapper
de_one_hot_encoding

Recovery One-Hot Encoding
get_ctree_rules

Parse party ctree rules
get_correlation_group

get_correlation_group
fast_high_cor_filter

high_cor_filter
lendingclub

Lending Club data
date_cut

Date Time Cut Point
merge_category

Merge Category
lasso_filter

Variable selection by LASSO
get_nas_random

get_nas_random
get_score_card

Score Card
re_name

Rename
min_max_norm

Min Max Normalization
re_code

re_code #' re_code search for matches to argument pattern within each element of a character vector:
plot_theme

plot_theme
plot_table

plot_table
split_bins

split_bins
start_parallel_computing

Parallel computing and export variables to global Env.
lift_value

lift_value
get_plots

Plot Independent Variables Distribution
get_x_list

Get X List.
loop_function

Loop Function. #' loop_function is an iterator to loop through
get_names

Get Variable Names
get_tree_breaks

Getting the breaks for terminal nodes from decision tree
digits_num

Number of digits
derived_ts_vars

Derivation of Behavioral Variables
get_median

get central value.
love_color

love_color
log_trans

Logarithmic transformation
get_psi_all

Calculate Population Stability Index (PSI) get_psi is used to calculate Population Stability Index (PSI) of an independent variable. get_psi_all can loop through PSI for all specified independent variables.
low_variance_filter

Filtering Low Variance Variables
train_test_split

Train-Test-Split
train_lr

Trainig LR model
lr_params

Logistic Regression & Scorecard Parameters
lr_vif

Variance-Inflation Factors
knn_nas_imp

Imputate nas using KNN
%islike%

Fuzzy String matching
is_date

is_date
%alike%

Fuzzy String matching
process_nas

Missing Treatment
derived_interval

derived_interval
fuzzy_cluster_means

Fuzzy Cluster means.
gbm_filter

Select Features using GBM
get_psi_iv_all

Calculate IV & PSI
pred_score

pred_score
pred_xgb

pred_xgb
rowAny

Functions for vector operation.
rf_params

Random Forest Parameters
process_outliers

Outliers Treatment
get_bins_table_all

Table of Binning
local_outlier_factor

local_outlier_factor local_outlier_factor is function for calculating the lof factor for a data set using knn This function is not intended to be used by end user.
read_dt

Read data
outliers_detection

Outliers Detection outliers_detection is for outliers detecting using Kmeans and Local Outlier Factor (lof)
remove_duplicated

Remove Duplicated Observations
one_hot_encoding

One-Hot Encoding
variable_process

variable_process
require_packages

Packages required and intallment
null_blank_na

Encode NAs
multi_left_jion

multi_left_jion
psi_iv_filter

Variable reduction based on Information Value & Population Stability Index filter
woe_trans_all

WOE Transformation
time_vars_process

Processing of Time or Date Variables
tnr_value

tnr_value
time_transfer

Time Format Transfering
reduce_high_cor

Compare the two highly correlated variables
time_varieble

time_varieble
select_best_class

Generates Best Binning Breaks
quick_as_df

List as data.frame quickly
xgb_params

XGboost Parameters
sim_str

sim_str
train_xgb

Training XGboost
stop_parallel_computing

Stop parallel computing
training_model

Training model
str_match

string match #' str_match search for matches to argument pattern within each element of a character vector:
get_breaks_all

Generates Best Breaks for Binning
get_shadow_nas

get_shadow_nas
ks_table

ks_table & plot
get_sim_sign_lambda

get_sim_sign_lambda get_sim_sign_lambda is for get Best lambda required in lasso_filter. This function required in lasso_filter
ks_value

ks_value
partial_dependence_plot

partial_dependence_plot
p_to_score

prob to socre
model_result_plot

model result plots model_result_plot is a wrapper of following: perf_table is for generating a model performance table. ks_plot is for K-S. roc_plot is for ROC. lift_plot is for Lift Chart. score_distribution_plot is for ploting the score distribution.
multi_grid

Arrange list of plots into a grid
score_transfer

Score Transformation
save_dt

Save data
xgb_data

XGboost data
xgb_filter

Select Features using XGB
char_to_num

character to number
address_varieble

address_varieble
PCA_reduce

PCA Dimension Reduction
char_cor_vars

Cramer's V matrix between categorical variables.
add_variable_process

add_variable_process
as_percent

Percent Format
analysis_nas

Missing Analysis
auc_value

auc_value auc_value is for get best lambda required in lasso_filter. This function required in lasso_filter
analysis_outliers

Outliers Analysis