Skip to main content

What is this?

Python helper for running vowpalwabbit on multiple command line arguments and have programmatic access to results.

Getting started

Initialize the wrapper

from vw_executor.vw import Vw
vw = Vw(
    'path to cache folder',
    'path to vw binary'         # Optional. If empty, pyvw is used
    )

Run on single configuration

result = vw.train(INPUTS, CONFIGURATION)

where

INPUTS - list of paths to input files

CONFIGURATION

Every configuration can be defined using one of the following ways:

  1. string. I.e.
result = vw.train(['input1.txt'], '--cb_explore_adf --dsjson')
  1. dictionary. In this case, for every key/value pair:
  • If value is None/NaN the whole pair is skipped
  • If key starts with '#', key is skipped
  • Otherwise f'{key} {value}' is added to command line

For example,

vw.train(['input1.txt'], {'#base': '--cb_explore_adf --dsjson', '--epsilon': 0.2, '--learning_rate': None})

is running vw binary with the following command line:

--cb_explore_adf --dsjson --epsilon 0.2

Run on multiple configurations

result = vw.train(INPUTS, CONFIGURATIONS)

CONFIGURATIONS is the list of CONFIGURATION here. It is recommended to use helper vw_opts.Grid class in order to create it. Grid can be constructed using one of the following ways:

  1. From Iterable of CONFIGURATION. For example,
from vw_executor.vw_opts import Grid
vw.train(['input1.txt'], Grid(['--cb_explore_adf --dsjson -l 0.1', '--cb_explore_adf --dsjson -l 0.2']))
  1. From dictionary with string keys and iterable values.
    1. Grid({'-k': ['v1', 'v2']}) is equivalent to Grid(['-k v1', '-k v2'])
    2. Grid({'-k1': [v1, v2], '-k2': [v3, v4]}) is equivalent to Grid(['-k1 v1 -k2 v3', '-k1 v1 -k2 v4', '-k1 v2 -k2 v3', '-k1 v2 -k2 v4'])

Grid supports multiplication("and") and summation("or") operators. For example,

Grid({
    '-k1': ['v1, v2']
}) * (Grid({'-k2': ['v3']}) + Grid({'-k3': ['v4']}))

is equivalent to

Grid(['-k1 v1 -k2 v3', '-k1 v1 -k3 v4', '-k1 v2 -k2 v3', '-k1 v2 -k3 v4'])

Metadata

Release files for vw-executor 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vw-executor 0.3.3
File Size Uploaded Provenance
vw-executor-0.3.3.tar.gz 14.8 kB Without provenance Details

Release files / vw-executor-0.3.3.tar.gz

Download URL vw-executor-0.3.3.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
71b270008f4665b7569e0c24b05f3320eafb6e0ea23a1d5192f34a3177453476
BLAKE2b-256 checksum
How to use checksums
032b2fbdbcd04971cd0f92591d2bffe878d4a65d9c9cf843e0f437d7701645f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Security for vw-executor 0.3.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page