night_bat
night_bat

Reputation: 3232

Calling Vowpal Wabbit from Python (3.4)

I'm interested in dealing with Vowpal Wabbit from the Python 3.4 on Mac OS X.

In particular, I need:

  1. Run VW via Python with a set of parameters (each run starts once previous finished)
  2. Write everything VW usually show in the Terminal window to a file
  3. *Optional. See Terminal window with VW's progress information

As for p.1-2 I just wrote

import os
header = '/Users/sas/vowpal_wabbit/vw/vw train.vw -f model.vw --loss_function logistic --passes '
for item in [2, 3, 4]:
    os.system(header + str(item) + ' >> output.txt')

VW saved my model but I see neither learning progress (as no Terminal window opened) nor anything in my output.txt file (it appears to be 0 length after all)

Any hints or suggestions would be very welcome.

Upvotes: 1

Views: 1772

Answers (1)

Martin Popel
Martin Popel

Reputation: 2670

I am not sure if it will suit your needs, but you may check these two Python wrappers for Vowpal Wabbit:

https://github.com/mokelly/wabbit_wappa

https://github.com/josephreisinger/vowpal_porpoise

Edit: recently, VW got Python interface: https://github.com/JohnLangford/vowpal_wabbit/tree/master/python

Upvotes: 3

Related Questions