Vowpal Wabbit: obtaining a readable_model when in

2019-09-08 15:00发布

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.

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 ?

1条回答
姐就是有狂的资本
2楼-- · 2019-09-08 15:47

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.

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

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:

  • make vw much slower
  • require parsing every line to get the values rather than on demand
查看更多
登录 后发表回答