All Projects → ShichenXie → Scorecard

ShichenXie / Scorecard

Licence: other
Scorecard Development in R, 评分卡

Programming Languages

r
7636 projects

Labels

Projects that are alternatives of or similar to Scorecard

Ngc
NewGoCommand - An opinionated and lightweight project starter. (WORK IN PROGRESS)
Stars: ✭ 16 (-87.2%)
Mutual labels:  release
Auto
Generate releases based on semantic version labels on pull requests.
Stars: ✭ 1,120 (+796%)
Mutual labels:  release
Npm
🚢 semantic-release plugin to publish a npm package
Stars: ✭ 103 (-17.6%)
Mutual labels:  release
Fugitive
Simple command line tool to make git more intuitive, along with useful GitHub addons.
Stars: ✭ 20 (-84%)
Mutual labels:  release
Automatic Release
Automates the release process for GitHub projects.
Stars: ✭ 46 (-63.2%)
Mutual labels:  release
Git Release
Publish a GitHub Release 📦 with Assets 📁 and Changelog 📄
Stars: ✭ 77 (-38.4%)
Mutual labels:  release
Shipjs
Take control of what is going to be your next release.
Stars: ✭ 668 (+434.4%)
Mutual labels:  release
Release Notes Generator
📋 semantic-release plugin to generate changelog content with conventional-changelog
Stars: ✭ 123 (-1.6%)
Mutual labels:  release
Metav
Release and Versioning of Clojure projects using tools.deps
Stars: ✭ 62 (-50.4%)
Mutual labels:  release
Bintray Publish
Super easy way to publish your Android and Java artifacts to bintray.
Stars: ✭ 97 (-22.4%)
Mutual labels:  release
Create Release
An Action to create releases via the GitHub Release API
Stars: ✭ 976 (+680.8%)
Mutual labels:  release
Github Releases Downloads Analysis
统计 Github Releases 的下载次数等信息 | Analysis your repo releases downloads
Stars: ✭ 46 (-63.2%)
Mutual labels:  release
Dune Release
Streamlining the release of dune packages to opam
Stars: ✭ 83 (-33.6%)
Mutual labels:  release
Condition Travis
🚫 semantic-release plugin to check Travis CI environment before publishing.
Stars: ✭ 9 (-92.8%)
Mutual labels:  release
Publish Nuget
📦 GitHub action to automate publishing NuGet packages when project version changes
Stars: ✭ 109 (-12.8%)
Mutual labels:  release
Github Release Notes
Node module to create a release or a changelog from a tag and uses issues or commits to creating the release notes.
Stars: ✭ 705 (+464%)
Mutual labels:  release
Please
please is semver release made easy
Stars: ✭ 72 (-42.4%)
Mutual labels:  release
Releases
dahliaOS ISO releases
Stars: ✭ 125 (+0%)
Mutual labels:  release
Git Changelog Lib
Library for parsing and generating a changelog, or releasenotes, from a GIT repository
Stars: ✭ 117 (-6.4%)
Mutual labels:  release
Rels
Github release analytics for the console
Stars: ✭ 90 (-28%)
Mutual labels:  release

scorecard

Travis build status CRAN_Status_Badge

The goal of scorecard package is to make the development of the traditional credit risk scorecard model easier and efficient by providing functions for some common tasks that summarized in below. This package can also used in the development of machine learning models on binary classification.

  • data preprocessing (split_df, replace_na, one_hot, var_scale)
  • weight of evidence (woe) binning (woebin, woebin_plot, woebin_adj, woebin_ply)
  • variable selection (var_filter, iv, vif)
  • performance evaluation (perf_eva, perf_cv, perf_psi)
  • scorecard scaling (scorecard, scorecard2, scorecard_ply)
  • scorecard report (gains_table, report)

Installation

  • Install the release version of scorecard from CRAN with:
install.packages("scorecard")
  • Install the latest version of scorecard from github with:
# install.packages("devtools")
devtools::install_github("shichenxie/scorecard")

Example

This is a basic example which shows you how to develop a common credit risk scorecard:

# Traditional Credit Scoring Using Logistic Regression
library(scorecard)

# data preparing ------
# load germancredit data
data("germancredit")
# filter variable via missing rate, iv, identical value rate
dt_f = var_filter(germancredit, y="creditability")
# breaking dt into train and test
dt_list = split_df(dt_f, y="creditability", ratios = c(0.6, 0.4), seed = 30)
label_list = lapply(dt_list, function(x) x$creditability)

# woe binning ------
bins = woebin(dt_f, y="creditability")
# woebin_plot(bins)

# binning adjustment
## adjust breaks interactively
# breaks_adj = woebin_adj(dt_f, "creditability", bins) 
## or specify breaks manually
breaks_adj = list(
  age.in.years=c(26, 35, 40),
  other.debtors.or.guarantors=c("none", "co-applicant%,%guarantor"))
bins_adj = woebin(dt_f, y="creditability", breaks_list=breaks_adj)

# converting train and test into woe values
dt_woe_list = lapply(dt_list, function(x) woebin_ply(x, bins_adj))

# glm / selecting variables ------
m1 = glm( creditability ~ ., family = binomial(), data = dt_woe_list$train)
# vif(m1, merge_coef = TRUE) # summary(m1)
# Select a formula-based model by AIC (or by LASSO for large dataset)
m_step = step(m1, direction="both", trace = FALSE)
m2 = eval(m_step$call)
# vif(m2, merge_coef = TRUE) # summary(m2)

# performance ks & roc ------
## predicted proability
pred_list = lapply(dt_woe_list, function(x) predict(m2, x, type='response'))
## Adjusting for oversampling (support.sas.com/kb/22/601.html)
# card_prob_adj = scorecard2(bins_adj, dt=dt_list$train, y='creditability', 
#                x=sub('_woe$','',names(coef(m2))[-1]), badprob_pop=0.03, return_prob=TRUE)
                
## performance
perf = perf_eva(pred = pred_list, label = label_list)
# perf_adj = perf_eva(pred = card_prob_adj$prob, label = label_list$train)

# score ------
## scorecard
card = scorecard(bins_adj, m2)
## credit score
score_list = lapply(dt_list, function(x) scorecard_ply(x, card))
## psi
perf_psi(score = score_list, label = label_list)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].