简体   繁体   English

如何在上下文强盗设置中打印 vowpal wabbit 回归 model

[英]how to print a vowpal wabbit regression model in contextual bandits setting

I am using vowpal wabbit for contextual bandit problem, in python. Vowpal wabbit has a prediction model that uses the doubly robust method to build a regression model to predict the cost for different actions.我在 python 中使用 vowpal wabbit 解决上下文强盗问题。Vowpal wabbit 有一个预测 model,它使用双稳健方法构建回归 model 来预测不同操作的成本。 This model is thenused by the exploration strategy to output predictions.这个 model 然后被探索策略用于 output 预测。

Is there a way to print (in python) what the predicted regression model is and what the variables, coefficients are.有没有办法打印(在 python 中)预测的回归 model 是什么以及变量、系数是什么。 I cannot find a way to print the model like a typical regression model summary (containing the variable, coefficients, std errors, p values etc.)我找不到像典型回归 model 摘要(包含变量、系数、标准误差、p 值等)那样打印 model 的方法

Depending on how you initialize vw in python, you could use the --invert_hash <file_name> command and that will print a readable version of the model to the file provided (see here for details).根据您在 python 中初始化 vw 的方式,您可以使用--invert_hash <file_name>命令并将 model 的可读版本打印到提供的文件中(有关详细信息,请参见此处)。

If you are using vw 9.1.0 you can also use this new experimental feature that exports the model in a json format (see release notes here , check for "Export model weights and readable feature names as JSON")如果您使用的是 vw 9.1.0,您还可以使用以 json 格式导出 model 的新实验功能(请参阅此处的发行说明,检查“将 model 权重和可读功能名称导出为 JSON”)

If you are building from source, the above experimental api has been recently exposed via the python interface (see here )如果您从源代码构建,上述实验性 api 最近已通过 python 接口公开(参见此处

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM