Code Monkey home page Code Monkey logo

Comments (5)

ShichenXie avatar ShichenXie commented on September 26, 2024

你给一个可重现的案例吧,比如用自带的数据集计算一下,看看能不能出现你这个问题

from scorecard.

longhua8800w avatar longhua8800w commented on September 26, 2024

这是 我的数据集
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.

ShichenXie avatar ShichenXie commented on September 26, 2024

我知道了,因为你有一个分箱没有bad,scorecard包为了可计算将这个0替换为0.9了。这里的问题是你为啥能容忍没有bad的分箱

from scorecard.

longhua8800w avatar longhua8800w commented on September 26, 2024

由于变量比较多,先对满足初步要求的的 也就是没有被 var_filter干掉的变量 做单变量分析。 做法是把trian的分箱,应用到test上。 默认用的是 tree 分箱。然后看train test两边的 iv ks 和 psi 作为进一步筛选变量的依据,并不会真用这个分箱,实际入模变量的分箱是手工做的,不会有这个问题。 数值计算中为解决下溢的问题 会把分母下溢的0替换成较小的数。这里替换成0.9是不是有点大?另外其他(非 Inf) woe值 也与woebin的结果有差异,是woebin小数点后保留位数不同导致的吗?

from scorecard.

longhua8800w avatar longhua8800w commented on September 26, 2024

??

from scorecard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.