gpt4 book ai didi

vowpalwabbit - Vowpal Wabbit reverse_hash选项产生空输出,但是为什么呢?

转载 作者:行者123 更新时间:2023-12-04 05:27:27 27 4
gpt4 key购买 nike

我正在尝试使用隐藏的散列来保存vowpal wabbit模型。我有一个有效的模型,它包含以下内容:
vw --oaa 2 -b 24 -d mydata.vw --readable_model mymodel.readable
生成如下模型文件:

Version 7.7.0
Min label:-1.000000
Max label:1.000000
bits:24
0 pairs:
0 triples:
rank:0
lda:0
0 ngram:
0 skip:
options: --oaa 2
:0
66:0.016244
67:-0.016241
80:0.026017
81:-0.026020
84:0.015005
85:-0.015007
104:-0.053924
105:0.053905
112:-0.015402
113:0.015412
122:-0.025704
123:0.025704
...

(依此类推,还有成千上万的功能)。但是,为了更有用,我需要查看功能名称。看起来很明显,但是我做到了
vw --oaa 2 -b 24 -d mydata.vw --invert_hash mymodel.inverted
并生成了这样的模型文件(不生成权重):
Version 7.7.0
Min label:-1.000000
Max label:1.000000
bits:24
0 pairs:
0 triples:
rank:0
lda:0
0 ngram:
0 skip:
options: --oaa 2
:0

好像我显然做错了什么,但我想我在使用 documented way中的选项:

--invert_hash is similar to --readable_model, but the model is output in a more human readable format with feature names followed by weights, instead of hash indexes and weights.



有谁知道为什么我的第二条命令无法产生任何输出?

最佳答案

这是由最近修复的VW错误(由于这个问题)引起的,请参阅https://github.com/JohnLangford/vowpal_wabbit/issues/337

顺便说一句,使用--oaa 2没有任何意义。如果要进行二进制分类(又称逻辑回归),请使用--loss_function=logistic(并确保标签为1和-1)。
OAA仅对N> 2个类有意义(建议将--loss_function=logistic--oaa一起使用)。

还要注意,使用--invert_hash学习比慢得多(当然,需要更多的内存)。推荐的创建反向哈希模型的方法(尤其是多次遍历)是学习一种常用的二进制模型,然后使用-t对训练数据进行一次遍历,然后将其转换为反向哈希:

vw -d mytrain.data -c --passes 4 -oaa 3 -f model.binary
vw -d mytrain.data -t -i model.binary --invert_hash model.humanreadable

关于vowpalwabbit - Vowpal Wabbit reverse_hash选项产生空输出,但是为什么呢?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24437152/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com