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.6

License

AGPL-3

Maintainer

Dongping Fan

Last Published

November 12th, 2019

Functions in creditmodel (1.1.6)

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
PCA_reduce

PCA Dimension Reduction
char_to_num

character to number
char_cor_vars

Cramer's V matrix between categorical variables.
address_varieble

address_varieble
as_percent

Percent Format
add_variable_process

add_variable_process
UCICreditCard

UCI Credit Card data
analysis_outliers

Outliers Analysis
cos_sim

cos_sim
cor_heat_plot

Correlation Heat Plot
customer_segmentation

Customer Segmentation
city_varieble_process

Processing of Address Variables
cv_split

Stratified Folds
cut_equal

Generating Initial Equal Size Sample Bins
city_varieble

city_varieble
cor_plot

Correlation Plot
data_cleansing

Data Cleaning
data_exploration

Data Exploration
derived_pct

derived_pct
derived_partial_acf

derived_partial_acf
cohort_analysis

cohort_analysis cohort_function is for cohort(vintage) analysis.
de_percent

Recovery Percent Format
derived_interval

derived_interval
cohort_table_plot

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

check_rules
checking_data

Checking Data
de_one_hot_encoding

Recovery One-Hot Encoding
date_cut

Date Time Cut Point
fast_high_cor_filter

high_cor_filter
derived_ts_vars

Derivation of Behavioral Variables
euclid_dist

euclid_dist
entry_rate_na

Max Percent of Missing Value
feature_selector

Feature Selection Wrapper
digits_num

Number of digits
gbm_params

GBM Parameters
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
get_correlation_group

get_correlation_group
get_ctree_rules

Parse party ctree rules
fuzzy_cluster_means

Fuzzy Cluster means.
gbm_filter

Select Features using GBM
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.
get_names

Get Variable Names
get_median

get central value.
get_logistic_coef

get logistic coef
get_bins_table_all

Table of Binning
get_breaks_all

Generates Best Breaks for Binning
get_nas_random

get_nas_random
get_tree_breaks

Getting the breaks for terminal nodes from decision tree
get_psi_plots

Plot PSI(Population Stability Index)
get_x_list

Get X List.
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.
get_plots

Plot Independent Variables Distribution
get_shadow_nas

get_shadow_nas
get_score_card

Score Card
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
high_cor_selector

Compare the two highly correlated variables
%alike%

Fuzzy String matching
lasso_filter

Variable selection by LASSO
ks_value

ks_value
get_psi_iv_all

Calculate IV & PSI
%islike%

Fuzzy String matching
knn_nas_imp

Imputate nas using KNN
lendingclub

Lending Club data
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.
multi_grid

Arrange list of plots into a grid
multi_left_join

multi_left_join
ks_table

ks_table & plot
loop_function

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

love_color
pred_xgb

pred_xgb
process_nas

Missing Treatment
partial_dependence_plot

partial_dependence_plot
log_trans

Logarithmic transformation
low_variance_filter

Filtering Low Variance Variables
min_max_norm

Min Max Normalization
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.
lift_value

lift_value
quick_as_df

List as data.frame quickly
ranking_percent_proc

Ranking Percent Process
lr_vif

Variance-Inflation Factors
null_blank_na

Encode NAs
merge_category

Merge Category
is_date

is_date
one_hot_encoding

One-Hot Encoding
read_data

Read data
plot_table

plot_table
pred_score

pred_score
plot_theme

plot_theme
split_bins

split_bins
re_code

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

Parallel computing and export variables to global Env.
time_transfer

Time Format Transfering
process_outliers

Outliers Treatment
score_transfer

Score Transformation
train_xgb

Training XGboost
time_series_proc

Process time series data
psi_iv_filter

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

Train-Test-Split
reduce_high_cor_filter

Filtering highly correlated variables with reduce method
save_data

Save data
re_name

Rename
lr_params

Logistic Regression & Scorecard Parameters
outliers_detection

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

Generates Best Binning Breaks
time_vars_process

Processing of Time or Date Variables
rowAny

Functions for vector operation.
rf_params

Random Forest Parameters
time_varieble

time_varieble
xgb_filter

Select Features using XGB
train_lr

Trainig LR model
xgb_params

XGboost Parameters
tnr_value

tnr_value
sim_str

sim_str
p_to_score

prob to socre
require_packages

Packages required and intallment
remove_duplicated

Remove Duplicated Observations
stop_parallel_computing

Stop parallel computing
training_model

Training model
woe_trans_all

WOE Transformation
str_match

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

variable_process
xgb_data

XGboost data