Learn R Programming

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
 
 B_model = training_model(dat = dat_train,
                         model_name = "UCICreditCard", target = "target", x_list = NULL,
                         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 = FALSE, 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.3.1

License

AGPL-3

Maintainer

Dongping Fan

Last Published

January 7th, 2022

Functions in creditmodel (1.3.1)

PCA_reduce

PCA Dimension Reduction
checking_data

Checking Data
city_varieble

city_varieble
derived_ts_vars

Derivation of Behavioral Variables
fast_high_cor_filter

high_cor_filter
derived_pct

derived_pct
cor_plot

Correlation Plot
derived_interval

derived_interval
cor_heat_plot

Correlation Heat Plot
derived_partial_acf

derived_partial_acf
analysis_outliers

Outliers Analysis
digits_num

Number of digits
date_cut

Date Time Cut Point
UCICreditCard

UCI Credit Card data
auc_value

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

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

Entropy Weight Method
knn_nas_imp

Imputate nas using KNN
get_breaks_all

Generates Best Breaks for Binning
feature_selector

Feature Selection Wrapper
de_one_hot_encoding

Recovery One-Hot Encoding
cos_sim

cos_sim
loop_function

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

get_correlation_group
de_percent

Recovery Percent Format
city_varieble_process

Processing of Address Variables
eval_auc

Functions of xgboost feval
ks_value

ks_value
gbm_filter

Select Features using GBM
ewm_data

Entropy Weight Method Data
creditmodel-package

creditmodel: toolkit for credit modeling and data analysis
get_bins_table_all

Table of Binning
get_psi_iv_all

Calculate IV & PSI
lasso_filter

Variable selection by LASSO
cohort_table_plot

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

get_nas_random
log_trans

Logarithmic transformation
get_psi_plots

Plot PSI(Population Stability Index)
n_char

The length of a string.
add_variable_process

add_variable_process
address_varieble

address_varieble
data_exploration

Data Exploration
get_score_card

Score Card
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.
train_lr

Trainig LR model
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.
replace_value

Replace Value
low_variance_filter

Filtering Low Variance Variables
customer_segmentation

Customer Segmentation
cv_split

Stratified Folds
get_median

get central value.
cut_equal

Generating Initial Equal Size Sample Bins
is_date

is_date
data_cleansing

Data Cleaning
get_names

Get Variable Names
fuzzy_cluster_means

Fuzzy Cluster means.
gbm_params

GBM Parameters
save_data

Save data
select_best_class

Generates Best Binning Breaks
sim_str

sim_str
time_series_proc

Process time series data
ks_table

ks_table & plot
one_hot_encoding

One-Hot Encoding
gather_data

gather or aggregate data
lendingclub

Lending Club data
multi_grid

Arrange list of plots into a grid
min_max_norm

Min Max Normalization
%alike%

Fuzzy String matching
woe_trans_all

WOE Transformation
require_packages

Packages required and intallment
outliers_detection

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

Merge Category
plot_table

plot_table
max_min_norm

Max Min Normalization
plot_colors

Plot Colors
pred_score

pred_score
love_color

love_color
variable_process

variable_process
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.
train_xgb

Training XGboost
train_test_split

Train-Test-Split
plot_oot_perf

plot_oot_perf plot_oot_perf is for ploting performance of cross time samples in the future
entry_rate_na

Max Percent of missing Value
lift_value

lift_value
score_transfer

Score Transformation
stop_parallel_computing

Stop parallel computing
str_match

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

euclid_dist
partial_dependence_plot

partial_dependence_plot
reduce_high_cor_filter

Filtering highly correlated variables with reduce method
plot_theme

plot_theme
get_logistic_coef

get logistic coef
var_group_proc

Process group numeric variables
training_model

Training model
get_shadow_nas

get_shadow_nas
quick_as_df

List as data.frame quickly
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
time_variable

time_variable
start_parallel_computing

Parallel computing and export variables to global Env.
time_vars_process

Processing of Time or Date Variables
remove_duplicated

Remove Duplicated Observations
%islike%

Fuzzy String matching
lr_vif

Variance-Inflation Factors
get_tree_breaks

Getting the breaks for terminal nodes from decision tree
lr_params

Logistic Regression & Scorecard Parameters
process_outliers

Outliers Treatment
ranking_percent_proc

Ranking Percent Process
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.
high_cor_selector

Compare the two highly correlated variables
process_nas

missing Treatment
multi_left_join

multi_left_join
re_name

Rename
rf_params

Random Forest Parameters
p_to_score

prob to socre
xgb_data

XGboost data
p_ij

Entropy
xgb_filter

Select Features using XGB
split_bins

split_bins
psi_iv_filter

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

Read data
split_bins_all

Split bins all
sql_hive_text_parse

Automatic production of hive SQL
rowAny

Functions for vector operation.
tnr_value

tnr_value
xgb_params

XGboost Parameters
sum_table

Summary table
null_blank_na

Encode NAs
re_code

re_code re_code search for matches to argument pattern within each element of a character vector:
time_transfer

Time Format Transfering
term_tfidf

TF-IDF
as_percent

Percent Format
char_cor_vars

Cramer's V matrix between categorical variables.
analysis_nas

missing Analysis
char_to_num

character to number