Comments (8)
这个例子的代码有问题,dt_s 并没有定义。
from scorecardpy.
你好,最近我发现使用sc.woebin会报错,TypeError: unhashable type: 'numpy.ndarray',通过尝试,发现在该函数在环境为python3.7的win/mac/linux能正常运行,环境为python3.8的mac/linux也能运行,但在3.8的windows下报错,原因是scorecardpy.woebin.woebin2_init_bin()函数中下面这段代码中,np.unique(x)会产生一个numpy.ndarray类型,应该是pandas版本的原因,将其改成np.unique(x)[0]可解决该问题,
init_bin = init_bin.groupby('brkp').agg({
'variable':lambda x: np.unique(x),
'bin': lambda x: '%,%'.join(x),
'good': sum,
'bad': sum
}).assign(badprob = lambda x: x['bad']/(x['good']+x['bad']))\
.reset_index()
from scorecardpy.
pandas最好使用1.4以下的版本
from scorecardpy.
这个例子的代码有问题,dt_s 并没有定义。
你好,使用的是本项目readme提供的Example代码,dt_s定义了
刚接触这块内容,还想问下这个项目实现基于哪些文档资料或者链接,是否方便告知下,以了解有些代码为什么这么写?
from scorecardpy.
你好,最近我发现使用sc.woebin会报错,TypeError: unhashable type: 'numpy.ndarray',通过尝试,发现在该函数在环境为python3.7的win/mac/linux能正常运行,环境为python3.8的mac/linux也能运行,但在3.8的windows下报错,原因是scorecardpy.woebin.woebin2_init_bin()函数中下面这段代码中,np.unique(x)会产生一个numpy.ndarray类型,应该是pandas版本的原因,将其改成np.unique(x)[0]可解决该问题,
init_bin = init_bin.groupby('brkp').agg({ 'variable':lambda x: np.unique(x), 'bin': lambda x: '%,%'.join(x), 'good': sum, 'bad': sum }).assign(badprob = lambda x: x['bad']/(x['good']+x['bad']))\ .reset_index()
谢谢,改成np.unique(x)[0]这个方法解决了这个问题,但执行readme中的Example代码又报了一个错:ValueError: Number of rows must be a positive integer, not 1.0,通过将scorecardpy-perf.py中 perf_eva 的subplot_nrows,subplot_ncols强制转化为整数解决。解决这两个问题后,在本地环境(本地环境 python3.10.4,pandas1.4.3)运行readme中Example代码运行成功。
from scorecardpy.
pandas最好使用1.4以下的版本
谢谢,由于本地还有其他功能,更改版本可能影响现有功能
from scorecardpy.
pandas 的向前兼容有点问题,可以试试R版本的scorecard,速度更快、也更稳定。python版本的包更新,需要等我处理好手上的其他事情。
from scorecardpy.
It should be fixed.
from scorecardpy.
Related Issues (20)
- 使用woebin分箱后,缺失值分箱WOE计算错误 HOT 3
- pandas版本的reset_index不支持name了 HOT 5
- woe_ply转换时,不能将缺失值转换成其对应woe HOT 6
- perf_eva() 函数报错问题 HOT 4
- 运行你的example中train_perf = sc.perf_eva(y_train, train_pred, title = "train") HOT 5
- sc.perf_psi HOT 1
- woe分箱问题 HOT 1
- woebin 0 and 1 replacing part
- The latest version 1.9.7 in Pypi HOT 1
- Example has problem of data leakage HOT 1
- 请问在使用woe_bin的时候,如何将missing这一分箱和其它分箱合并 HOT 1
- 系数正负问题 HOT 6
- woebin分箱结果异常 HOT 4
- 两个地方算出来的iv不同 HOT 1
- Can we use XGBRegressor? HOT 5
- Default values for pdo, points0 and odds0 HOT 2
- 请问包中具体用的分箱算法是哪一种 HOT 14
- remould this card HOT 2
- 改造评分卡的预测模型 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 scorecardpy.