Vowpal Wabbit Python package
Project description
Vowpal Wabbit is a fast machine learning library for online learning, and this is the python wrapper for the project.
Installing this package builds Vowpal Wabbit locally for explicit use within python, it will not create the command-line version of the tool (or affect any previously existing command-line installations). To install the command-line version see the main project page: https://github.com/VowpalWabbit/vowpal_wabbit
The version of the PyPI vowpalwabbit package corresponds to the tagged version of the code in the github repo that will be used during building and installation. If you need to make local changes to the code and rebuild the python binding be sure to pip uninstall vowpalwabbit then rebuild using the local repo installation instructions below.
Installation
See the installation instructions
Usage
You can use the python wrapper directly like this:
>>> import vowpalwabbit
>>> vw = vowpalwabbit.Workspace(quiet=True)
>>> ex = vw.example('1 | a b c')
>>> vw.learn(ex)
>>> vw.predict(ex)
Or you can use the included scikit-learn interface like this:
>>> import numpy as np
>>> from sklearn import datasets
>>> from sklearn.model_selection import train_test_split
>>> from vowpalwabbit.sklearn import VWClassifier
>>>
>>> # generate some data
>>> X, y = datasets.make_hastie_10_2(n_samples=10000, random_state=1)
>>> X = X.astype(np.float32)
>>>
>>> # split train and test set
>>> X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=256)
>>>
>>> # build model
>>> model = VWClassifier()
>>> model.fit(X_train, y_train)
>>>
>>> # predict model
>>> y_pred = model.predict(X_test)
>>>
>>> # evaluate model
>>> model.score(X_train, y_train)
>>> model.score(X_test, y_test)
Troubleshooting
See the troubleshooting guide
Development
Contributions are welcome for improving the python wrapper to Vowpal Wabbit.
Check for open issues or create one to discuss a feature idea or bug.
Fork the repo on Github and make changes to the master branch (or a new branch off of master).
Write a test in the python/tests folder showing the bug was fixed or feature works (recommend using pytest).
Make sure package installs and tests pass under all supported environments (this calls tox automatically).
Send the pull request.
Tests can be run using setup.py:
$ python setup.py test
Directory Structure:
python : this is where the c++ extension lives
python/vowpalwabbit : this is then main directory for python wrapper code and utilities
python/examples : example python code and jupyter notebooks to demonstrate functionality
python/tests : contains all tests for python code
Note: neither examples nor tests directories are included in the distributed package, they are only for development purposes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for vowpalwabbit-9.10.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c76aacfdb98060262dbdf7d02453af187197905994ca90bd4b3c2edb1c9fe84c |
|
MD5 | 69d52b983b7ceb641ee66c0475286811 |
|
BLAKE2b-256 | 2cc478e72c38719577704722649f964ad0c97e73c1ff9889ed39a74542cc4159 |
Hashes for vowpalwabbit-9.10.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d807b149988020bcf65f8739bc32021b622c15c544ae018d5fa41834b3f85ca |
|
MD5 | 2077b76054819391e349d2db1cf77d43 |
|
BLAKE2b-256 | 519a1cafcac6ba10e731444ca977135a9f1bb296dca529e1323d05d1e5ccf3ed |
Hashes for vowpalwabbit-9.10.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38ae89749bda9399a66cac10cdeae4ef1a5f0e48a44fe30c8ac5e31ac564e042 |
|
MD5 | 6d7624f1a1ae57875571dec627816982 |
|
BLAKE2b-256 | 3f233154a48c8c8f19efecd23ee59669bfe79ddc2371ea17245ced59468f8747 |
Hashes for vowpalwabbit-9.10.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 177ff8548239daa534260d45f14263f15df7af567c58f768d19bade5f34f86cf |
|
MD5 | 253a1ddfef2d20140e73adfb1fa41626 |
|
BLAKE2b-256 | 1391bb34d9df2a24f46882c5f527bad295a9e0c4be3a1a45f4fee6fd8ca5ad0e |
Hashes for vowpalwabbit-9.10.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 59380da4d801cf8c02d8de4a4b4f3bb27301da427d1001d1b44e0440580ad3ab |
|
MD5 | 0318d70db549eef6728ffe7e218c6417 |
|
BLAKE2b-256 | c1af64eac89867703ff4ca6243742c12639b761d4033065335367c1cb0c1259e |
Hashes for vowpalwabbit-9.10.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62831189fb3fb1957b4b7122baea03cb00984fb179662128f4c09b6aa78bb21b |
|
MD5 | 4c956f5d14370e8a56d18a609fb6d5fa |
|
BLAKE2b-256 | bedebbfd11675ecbe4bc0c75fa51a983f11885dadfae52e2dd7de39a86be25d4 |
Hashes for vowpalwabbit-9.10.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d6d5cd93dbfff5b536a133ca8d943f0ea672eb439b0c9d986af1934687ef7ce |
|
MD5 | 97d92f975b087c89b4a6fe7d8315f86d |
|
BLAKE2b-256 | 9ad5fc622677624249bc9d4c3b01f650d6a988169d76438b18ffa5f64649b563 |
Hashes for vowpalwabbit-9.10.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a975f06172aa8817c67890ef7381596b2f8a0c6b6f747e53085fab08cfacfa3 |
|
MD5 | c7d773b9efa4c07bc0df9f64220b5497 |
|
BLAKE2b-256 | cb255db978157c456a144ce282a949c3ef148a558a088451f46d7a8ad9e90507 |
Hashes for vowpalwabbit-9.10.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47f4d016239d310adfe441445cbca20e5bc7b208e9a7eecac2895eeffd239388 |
|
MD5 | fb2178a6ccaae78fe2123f6de3c9921e |
|
BLAKE2b-256 | 36bbd54efddca04c8b6a8d776ef41c90d5a2084bf7e76585b71901c85be6bf25 |
Hashes for vowpalwabbit-9.10.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a3d08490d2a21fdce0bd397ce46a572046fa5ee83fd6d648188d792eabc652e |
|
MD5 | dedac5afc511d0e34ba52b07a6074754 |
|
BLAKE2b-256 | 15364ab1456173d4c86875eef2357c4526ce01d7043e68e9ca78905410e7016c |
Hashes for vowpalwabbit-9.10.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7144119a90e91f4f3e9cc1e6f156c6ef83520c9229d1c66c3eb41288698ba5e9 |
|
MD5 | 61a7fa0f4afffab14982b8e77e29d8f8 |
|
BLAKE2b-256 | bce2d27a9706057b32bbdb60bfccc90b49930d18f1b98f5e28f51f77bfc1b9c1 |
Hashes for vowpalwabbit-9.10.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 104970bc6483234083f648a19b1139b2e9d9c5e5576789cb1d0d004dd27226e1 |
|
MD5 | fa9736487421e272224529aae1fa2986 |
|
BLAKE2b-256 | 7d37105980b868658128d21f30a52dff3798f4a389d20e5e426880a5f187615c |
Hashes for vowpalwabbit-9.10.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2b6d3217253f1007ac135258adeec10b56918cff7d66468330eef051a68de0d4 |
|
MD5 | 127a46b4662ff85553efaf902ae3bec2 |
|
BLAKE2b-256 | b0474ed7f265e556715f99c70b83878ec07a5d90ebde4509cd3c77681eef0c10 |
Hashes for vowpalwabbit-9.10.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6151b47479810f611ae071e66c5f169106361a1a6f18f43d22d18d87cd73c07f |
|
MD5 | c8c992fe4ddb69ac8cdf4eed37cb7e9f |
|
BLAKE2b-256 | 8be95d18c483f8cd5ddf165d915f6caf6589f93b673a4acd36f11af557383267 |
Hashes for vowpalwabbit-9.10.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08fbb3855ef1f60f77b6d823396d897eb1f1859689d1bd3027d1e2a6c8ccad89 |
|
MD5 | 6b5f5d8906b201189fd17504c7d5d9f0 |
|
BLAKE2b-256 | c622927bd670e990384c18cf978f3d8669570551edbcc758ca7a861c39256b6d |
Hashes for vowpalwabbit-9.10.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5eb3ee70631401dcb058ccfb808974303cc89f2f8629dd73cb826e9d81c9c3bf |
|
MD5 | 09a2adc8ad322d8da2723825e1054643 |
|
BLAKE2b-256 | 93ba5d9aab0f4cd6eef67e6b46630e0ef1475e4fff9af1f402f474d572f478e4 |
Hashes for vowpalwabbit-9.10.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0072140625c93ef4e4c913e19546a325934e798507bef0c526041d7a4c104142 |
|
MD5 | 628afecbeb698648a624d0519d68f4fe |
|
BLAKE2b-256 | e5ff399f4a1b449b340c8a0c3d8ba3ef007afb7657097bc1e07e013c837cc9be |
Hashes for vowpalwabbit-9.10.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3d515d41a7ef0b6c0d6b89b4d9418cc9d24d6d492bffbd6d89972542bc50ff2 |
|
MD5 | e446e39cee7d324768d00c564cfdb7cd |
|
BLAKE2b-256 | b96568914310815174a2b1f4098321420ce0b46a3820611201039cf60312a3d4 |
Hashes for vowpalwabbit-9.10.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a47adb1785d5eb390a6360417ceb4e58ff1253674f7647d5a4614211145ca3e |
|
MD5 | 51c29bc3b90fb91aea86f0a75ca3794e |
|
BLAKE2b-256 | 4b57907c7eefc007625f82118639f02fde8d6647b014d24dc66ddc6fb56b4481 |
Hashes for vowpalwabbit-9.10.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d04f3183216f3656bc91c795df53423927b9ffe6456d6b637da3e34c2ce900ef |
|
MD5 | 52c1d13e7c7d27fd700e75c167de230d |
|
BLAKE2b-256 | aa245084c77cea1c7cf96e83d1ccdaeeb5ab3b0caa1d8d31a7814a0df4ff5e1d |
Hashes for vowpalwabbit-9.10.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b04000984b8436775d1617046d8729f32ccef47815eef5ba1eefd393232ca4d |
|
MD5 | c52b3b09c47c9410646e0a590ca2e3f9 |
|
BLAKE2b-256 | 15b56a93c766489f9b65f9cca6a739062eb5785988cfa88e4c3ee64d7ed3e3e2 |
Hashes for vowpalwabbit-9.10.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1078defcf133431b041964c484e7631ea7a67e404ff55bd1bd940f283fd68342 |
|
MD5 | 6f98e4e6474a5e24fa9dde7bee43131a |
|
BLAKE2b-256 | f4cdcc081987a31d40bc5106f9426005ce42aba0a009761cac034d9667b9a3da |