These are a new set of bindings for VowpalWabbit. Parity with the existing bindings is not a goal of this project as it is an opportunity for a clean slate and opportunity to rethink old decisions. The interfaces here are all subject to change so be prepared for things to change if you use this library.
pip install vowpal-wabbit-next
import vowpal_wabbit_next as vw
import io
cb_input = io.StringIO(
"""shared | s
0:1:0.5 | a=0
| a=1
shared | s
| a=0
1:0:0.5 | a=1"""
)
workspace = vw.Workspace(["--cb_explore_adf"])
with vw.TextFormatReader(workspace, cb_input) as reader:
for event in reader:
print(workspace.predict_then_learn_one(event))
Wheels are provided for the following platforms:
# Build
export CMAKE_TOOLCHAIN_FILE=$(pwd)/ext_libs/vcpkg/scripts/buildsystems/vcpkg.cmake
pip install -v .
# Install dev dependncies
pip install -r requirements-dev.txt
# Test
pytest
# Type check
mypy
# Format
black src tests
# Check documentation
pydocstyle src
After updating the native module the type stub must be updated. This can be done automatically like so (ideally automatically in future, or at least checked if it is stale):
./generate_types.sh