gpt4 book ai didi

machine-learning - 关于vowpal_wabbit的输入格式

转载 作者:行者123 更新时间:2023-11-30 09:53:27 24 4
gpt4 key购买 nike

我在这方面是新手。我想用一系列数据进行训练并进行预测。我已经尝试了很长时间了,你能告诉我我出了什么问题吗?

我的火车数据如下所示(我在这里选择前几行):

-1 '13731#276 |f gender:0 age_range:2 action0:1 action1:0 action2:1 action3:0
-1 '70175#4214 |f gender:0 age_range:4 action0:0 action1:0 action2:1 action3:0
-1 '89370#2598 |f gender:1 age_range:2 action0:8 action1:0 action2:1 action3:0
1 '89371#1250 |f gender:0 age_range:2 action0:0 action1:0 action2:1 action3:0
-1 '89372#2792 |f gender:1 age_range:5 action0:0 action1:0 action2:1 action3:0
1 '89372#962 |f gender:1 age_range:5 action0:0 action1:0 action2:1 action3:0
-1 '89373#4472 |f gender:0 age_range:7 action0:5 action1:0 action2:1 action3:0

测试数据如下:

1 '177796#1807 |f gender:0 age_range:5 action0:5 action1:0 action2:1 action3:0
1 '155638#2445 |f gender:0 age_range:7 action0:3 action1:0 action2:1 action3:0
1 '155639#658 |f gender:1 age_range:2 action0:5 action1:0 action2:1 action3:0
1 '127479#2480 |f gender:0 age_range:7 action0:0 action1:0 action2:1 action3:0
1 '127478#1245 |f gender:0 age_range:4 action0:1 action1:0 action2:1 action3:0
1 '127473#4995 |f gender:1 age_range:4 action0:13 action1:0 action2:1 action3:0
1 '127472#45 |f gender:0 age_range:7 action0:4 action1:0 action2:1 action3:0

是的,它们看起来没有什么不同。我不知道这是否正确。我看到github上很多人都是这样写的。

我的大众命令如下:

vw -d train.vw --loss_function=logistic -f model.vw
vw -d test.vw -t -i model.vw --loss_function=logistic -r shop.preds.txt

嗯,结果是

-2.816693 177796#1807
-2.817430 155638#2445
-2.981194 155639#658
-2.821442 127479#2480
-2.823012 127478#1245
-2.968556 127473#4995
-2.816092 127472#45
-2.820939 127471#4010
-2.975476 127470#593
-2.820105 155634#4103
-2.799539 155635#2980
-3.139279 127475#1469

我不知道为什么,数字变得小于-2,事实上我理想的结果是这样的:

202178#1665,0.67
156148#4730,0.50
132360#2459,0.24
132360#144,0.99
180387#1534,0.48
187963#1360,0.19
158187#2534,0.54
188206#4890,0.70

至少我希望数字是正确的,但全是1。你能告诉我如何解决这个问题吗?谢谢!

最佳答案

如果您想预测概率,则应使用 vw -d test.vw -t -i model.vw --loss_function=logistic -r shop.preds.txt
vw -d test.vw -t -i model.vw --loss_function=logistic --link=logistic -p shop.preds.txt

如果你想获得最可能的标签(-1或+1),请使用
vw -d test.vw -t -i model.vw --loss_function=logistic --binary -p shop.preds.txt

参见https://github.com/JohnLangford/vowpal_wabbit/wiki/Predicting-probabilities

关于machine-learning - 关于vowpal_wabbit的输入格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40274804/

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