Comments (5)
你给一个可重现的案例吧,比如用自带的数据集计算一下,看看能不能出现你这个问题
from scorecard.
这是 我的数据集
train.zip
这是我的代码
library(tidyverse)
library(scorecard)
train <- read_csv("temp/scorcard_woe_problem/train.csv")
bins <- woebin(train,y = "y")
bins$score1%>%
mutate(pg = good / sum(good),
pb = bad / sum(bad),
woe1=log(pb/pg))%>%
select( bin,woe,woe1)
问题的具体体现 就是 最后这一步 woe 和 woe1 不一致,尤其是 woe 是 -Inf的地方
from scorecard.
我知道了,因为你有一个分箱没有bad,scorecard包为了可计算将这个0替换为0.9了。这里的问题是你为啥能容忍没有bad的分箱
from scorecard.
由于变量比较多,先对满足初步要求的的 也就是没有被 var_filter干掉的变量 做单变量分析。 做法是把trian的分箱,应用到test上。 默认用的是 tree 分箱。然后看train test两边的 iv ks 和 psi 作为进一步筛选变量的依据,并不会真用这个分箱,实际入模变量的分箱是手工做的,不会有这个问题。 数值计算中为解决下溢的问题 会把分母下溢的0替换成较小的数。这里替换成0.9是不是有点大?另外其他(非 Inf) woe值 也与woebin的结果有差异,是woebin小数点后保留位数不同导致的吗?
from scorecard.
??
from scorecard.
Related Issues (20)
- Formulas HOT 1
- 关于woebin等频分箱报错 HOT 2
- Gini with to = 'bin' HOT 1
- Scorecard2 issue with probability set to TRUE HOT 2
- question min and max score HOT 1
- Information Value from scorecard::iv() is not equal to Information value from scorecard::woebin() HOT 3
- 分箱区间问题 HOT 3
- woebin 指定breaklist时有问题 HOT 13
- Line plot for woebin_adj with line_value = "woe" resets to positive probability after adjusting breaks HOT 5
- Native pipe |> requires R >=4.1 HOT 1
- Cannot install.packages("scorecard") on windows HOT 2
- Fail to install - 0.3.9 HOT 2
- Definition of offset in the scorecard function HOT 1
- Is there any way to export the scorecard to PMML? HOT 8
- Error after latest update HOT 1
- Woe and points do not follow the same pattern HOT 2
- Function error HOT 5
- Let we choose whether to let the missing value be a separate bin HOT 3
- woebin持续运算得不到结果 HOT 2
- woebin bug (?) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from scorecard.