Vowpal Wabbit-如何从测试样本的上下文强盗模型中获得预测概率 [英] Vowpal Wabbit - How to get prediction probabilities from contextual bandit model on a test sample

查看:144
本文介绍了Vowpal Wabbit-如何从测试样本的上下文强盗模型中获得预测概率的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定一个训练有素的上下文盗贼模型,我该如何检索测试样本上的预测向量?

Given a trained contextual bandit model, how can I retrieve a prediction vector on test samples?

例如,假设我有一个名为"train.dat"的火车,其中包含以下格式的行

For example, let's say I have a train set named "train.dat" containing lines formatted as below

1:-1:0.3 | a b c  # <action:cost:probability | features> 
2:2:0.3 | a d d 
3:-1:0.3 | a b e
....

我在命令下运行.

vw -d train.dat --cb 30 -f cb.model --save_resume

这将产生一个文件"cb.model".现在,假设我有一个如下的测试数据集

This produces a file, 'cb.model'. Now, let's say I have a test dataset as below

| a d d 
| a b e

我希望看到以下概率

0.2 0.7 0.1

这些概率的解释是,应在20%的时间选择动作1,在2-70%的动作中选择动作3-10%的时间.

The interpretation of these probabilities would be that action 1 should be picked 20% of the time, action 2 - 70%, and action 3 - 10% of the time.

有没有办法得到这样的东西?

Is there a way to get something like this?

推荐答案

当您使用"--cb K"时,预测是基于argmax策略(一种静态策略)的最佳操作/动作.

When you use "--cb K", the prediction is the optimal arm/action based on argmax policy, which is a static policy.

使用"--cb_explore K"时,预测输出包含每个手臂/动作的概率.根据您选择的策略,概率的计算方式有所不同.

When using "--cb_explore K", the prediction output contains the probability for each arm/action. Depending the policy you pick, the probabilities are calculated differently.

这篇关于Vowpal Wabbit-如何从测试样本的上下文强盗模型中获得预测概率的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆