ShichenXie / scorecardpy

Scorecard Development in python, 评分卡
http://shichen.name/scorecard
MIT License
725 stars 301 forks source link

perf_eva() 函数报错问题 #104

Closed suiyilalala closed 1 year ago

suiyilalala commented 1 year ago

谢老师好 perf_eva() 使用过程中报错如下: ValueError: Number of rows must be a positive integer, not 1.0 `ValueError Traceback (most recent call last) ~\AppData\Local\Temp\ipykernel_4740\3289853055.py in 1 # performance ks & roc ------ ----> 2 train_perf = sc.perf_eva(y_train, train_pred, title = "train") 3 test_perf = sc.perf_eva(y_test, test_pred, title = "test")

E:\Anaconda\lib\site-packages\scorecardpy\perf.py in perf_eva(label, pred, title, groupnum, plot_type, show_plot, positive, seed) 316 fig = plt.figure() 317 for i in np.arange(len(plist)): --> 318 plt.subplot(subplot_nrows,subplot_ncols,i+1) 319 eval(plist[i]) 320 plt.show()`

ShichenXie commented 1 year ago

能提供代码和数据让我复现么

suiyilalala commented 1 year ago

我用的是example里的代码 。numpy版本是1.21.5, 会不会是依赖包的版本问题啊

suiyilalala commented 1 year ago

image ceil函数向上取整返回的是浮点数,但是subplot()函数需要传的参数是整数,这应该就是报错 ‘ValueError: Number of rows must be a positive integer, not 1.0’ 的原因了

ShichenXie commented 1 year ago

新版本matplotlib不支持了。已经修复,谢谢