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

require(creditmodel)
if (!dir.exists("c:/test_model")) dir.create("c:/test_model")
setwd("c:/test_model")
#set parameters
LR.params = lr_params(
bins_control = list(bins_num = 8,bins_pct = 0.05, b_chi = 0.02, 
b_odds = 0.1,b_psi = 0.02,b_gb = 0.15,mono = 0.3,gb_psi = 0.05,kc = 1),
score_card = TRUE, cor_p = 0.7, iv_i = 0.02, psi_i = 0.1 )
XGB.params = xgb_params(nrounds = 10000, 
params = list(max.depth = 4, eta = 0.01, min_child_weight = 50, subsample = 0.5, colsample_bytree = 0.6, gamma = 0, max_delta_step = 1, eval_metric = "auc", objective = "binary:logistic"), early_stopping_rounds = 300)
#training model
Lending_model = training_model(
dat = lendingclub,
model_name = "lendingclub", target = "loan_status", occur_time = "issue_d",
ex_cols = c("last_credit_pull_d", "next_pymnt_d", "prncp|recoveries|rec_|funded_amnt|pymnt|fee$"),
obs_id = "id", prop = 0.7,
feature_filter = list(filter = c("IV", "PSI", "COR", "XGB"), cv_folds = 1, iv_cp = 0.02,
psi_cp = 0.1, cor_cp = 0.8,xgb_cp = 0, hopper = TRUE), algorithm = list("LR", "XGB"),
LR.params = LR.params, XGB.params = XGB.params,
parallel = FALSE,
save_pmml = FALSE,
 plot_show = FALSE,
seed = 46)

Copy Link

Version

Install

install.packages('creditmodel')

Monthly Downloads

543

Version

1.1.1

License

AGPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Dongping Fan

Last Published

July 18th, 2019

Functions in creditmodel (1.1.1)

as_percent

Percent Format
char_cor_vars

Cramer's V matrix between categorical variables.
add_variable_process

add_variable_process
analysis_nas

Missing Analysis
PCA_reduce

PCA Dimension Reduction
checking_data

Checking Data
data_exploration

Data Exploration
data_cleansing

Data Cleaning
city_varieble

city_varieble
cv_split

Stratified Folds
cut_equal

Generating Initial Equal Size Sample Bins
entry_rate_na

Max Percent of Missing Value
euclid_dist

euclid_dist
char_to_num

character to number
date_cut

Date Time Cut Point
de_one_hot_encoding

Recovery One-Hot Encoding
cor_plot

Correlation Plot
city_varieble_process

Processing of Address Variables
cos_sim

cos_sim
fast_high_cor_filter

high_cor_filter
feature_select_wrapper

Feature Selection Wrapper
derived_partial_acf

derived_partial_acf
derived_pct

derived_pct
customer_segmentation

Customer Segmentation
derived_ts_vars

Derivation of Behavioral Variables
digits_num

Number of digits
gbm_params

GBM Parameters
de_percent

Recovery Percent Format
get_correlation_group

get_correlation_group
fuzzy_cluster_means

Fuzzy Cluster means.
get_ctree_rules

Parse party ctree rules
gbm_filter

Select Features using GBM
get_score_card

Score Card
get_shadow_nas

get_shadow_nas
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_logistic_coef

get logistic coef
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_bins_table_all

Table of Binning
get_names

Get Variable Names
get_median

get central value.
lasso_filter

Variable selection by LASSO
ks_value

ks_value
knn_nas_imp

Imputate nas using KNN
ks_table

ks_table & plot
min_max_norm

Min Max Normalization
merge_category

Merge Category
null_blank_na

Encode NAs
one_hot_encoding

One-Hot Encoding
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.
derived_interval

derived_interval
%islike%

Fuzzy String matching
is_date

is_date
get_psi_iv_all

Calculate IV & PSI
remove_duplicated

Remove Duplicated Observations
require_packages

Packages required and intallment
get_nas_random

get_nas_random
get_breaks_all

Generates Best Breaks for Binning
get_plots

Plot Independent Variables
re_name

Rename
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.
process_nas

Missing Treatment
%alike%

Fuzzy String matching
lendingclub

Lending Club data
get_x_list

Get X List.
process_outliers

Outliers Treatment
save_dt

Save data
quick_as_df

List as data.frame quickly
love_color

love_color
loop_function

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

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

Score Transformation
get_tree_breaks

Getting the breaks for terminal nodes from decision tree
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
reduce_high_cor

Compare the two highly correlated variables
split_bins

split_bins
low_variance_filter

Filtering Low Variance Variables
start_parallel_computing

Parallel computing and export variables to global Env.
train_test_split

Train-Test-Split
training_model

Training model
outliers_detection

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

Generates Best Binning Breaks
sim_str

sim_str
plot_theme

plot_theme
woe_trans_all

WOE Transformation
lr_params

Logistic Regression & Scorecard Parameters
rf_params

Random Forest Parameters
rowAny

Functions for vector operation.
time_transfer

Time Format Transfering
stop_parallel_computing

Stop parallel computing
xgb_filter

Select Features using XGB
xgb_params

Logistic Regression & Scorecard Parameters
time_varieble

time_varieble
time_vars_process

Processing of Time or Date Variables
variable_process

variable_process
vintage_function

vintage_function vintage_function is for vintage analysis.
auc_value

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

address_varieble
analysis_outliers

Outliers Analysis
UCICreditCard

UCI Credit Card data