问题描述
我正在尝试以--daemon模式将数据流传输到vw,并希望最后获得每个变量的系数值.因此,我希望vda在--daemon模式下执行以下任一操作: -给我发回我发送的每一行数据的系数的当前值. -以-可读模型"格式编写结果模型.
I am trying to stream my data to vw in --daemon mode, and would like to obtain at the end the value of the coefficients for each variable.Therefore I'd like vw in --daemon mode to either: - send me back the current value of the coefficients for each line of data I send. - Write the resulting model in the "--readable_model" format.
我知道关于虚拟示例技巧save_namemodel | ...
,该技巧可以将vw设为守护程序模式以将模型保存到给定的文件中,但这还不够,因为我无法访问该文件中的系数值.
I know about the dummy example trick save_namemodel | ...
to get vw in daemon mode to save the model to a given file, but it isn't enough as I can't access the coefficient values from that file.
关于如何解决问题的任何想法吗?
Any idea on how I could solve my problem ?
推荐答案
不幸的是,代码中目前尚不支持按需保存可读模型,但添加起来并不难.开源软件可让用户根据自己的需求进行改进.您可以在github上打开一个问题,或者更好地贡献所做的更改.
Unfortunately, on-demand saving of readable models isn't currently supported in the code but it shouldn't be too hard to add. Open source software is there for users to improve according to their needs. You may open a issue on github, or better, contribute the change.
请参阅:此代码行,其中使用 save_predictor() .可以设想一个 保存" 或 保存" 标签/命令,以可读形式存储回归变量为正在在此代码行中完成
See:this code line where only the binary regressor is saved using save_predictor(). One could envision a "rsave" or "saver" tag/command to store the regressor in readable form as is being done in this code line
作为一种解决方法,您可以使用--audit
调用vw并分析每个审核行的功能名称及其当前权重,但这将:
As a work-around you may call vw with --audit
and parse every audit line for the feature names and their current weights but this would:
- 让大众汽车慢得多
- 需要解析每一行以获取值,而不是按需
这篇关于Vowpal Wabbit:处于--daemon模式时,获取可读模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!