如何在没有省略号的情况下打印所有eli5.explain_weights()结果?

时间:2019-02-21 00:57:32

标签: python machine-learning keras

我想打印所有功能的功能重要性,但我会继续只介绍前几个功能。

我尝试过的功能:

print(eli5.format_as_text(eli5.explain_weights(perm)))

print(eli5.format_as_html(eli5.explain_weights(perm)))

以及格式函数show=("WEIGHTS", "ALL")上的show选项,但它们都只打印前几个答案,然后用省略号省略其余内容,如下所示:

0.0955 ± 0.1404  x23
0.0490 ± 0.0661  x33
0.0401 ± 0.0253  x64
0.0324 ± 0.0245  x37
0.0263 ± 0.0480  x111
0.0253 ± 0.0057  x107
0.0248 ± 0.0237  x36
0.0245 ± 0.0265  x81
0.0209 ± 0.0173  x46
0.0139 ± 0.0129  x80
0.0126 ± 0.0121  x14
0.0125 ± 0.0182  x1
0.0122 ± 0.0110  x110
0.0113 ± 0.0135  x51
0.0113 ± 0.0198  x116
0.0106 ± 0.0063  x11
0.0104 ± 0.0153  x66
0.0088 ± 0.0278  x113
0.0086 ± 0.0236  x67
0.0085 ± 0.0194  x21
    … 101 more …   

是否可以打印所有内容?

1 个答案:

答案 0 :(得分:1)

将属性top=100传递到explain_weights就像eli5.explain_weights(perm, top=100)

https://eli5.readthedocs.io/en/latest/autodocs/eli5.html?highlight=top

看起来默认值为20:https://eli5.readthedocs.io/en/latest/_modules/eli5/sklearn/explain_weights.html?highlight=_TOP

请参见_TOP=20