{
"info": {
"author": "Matej Jakimov",
"author_email": "matej.jakimov@gmail.com",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Topic :: Software Development :: Libraries"
],
"description": "Fast Python Vowpal Wabbit wrapper\n=================================\n\n*For Kaggle playing use official vowpalwabbit package, for production use subwabbit.*\n\n**subwabbit** is Python wrapper around great `Vowpal Wabbit `_ tool\nthat aims to be as fast as Vowpal itself. It is ideal for real time use, when many lines need to be scored\nin just few milliseconds or when high throughput is required.\n\n**Advantages**:\n\n- more then 4x faster then official Python wrapper\n- good latency guarantees - give 10ms for prediction and it will end in 10ms\n- explainability - API for explaining prediction value\n- use just ``vw`` CLI - no compiling\n- proven by reliably running in production at Seznam.cz where it makes hundreds of thousands\n of predictions per second per machine\n\nDocumentation\n-------------\nFull documentation can be found on `Read the docs `_.\n\nRequirements\n------------\n\n- Python 3.4+\n- Vowpal Wabbit\n\nYou can install Vowpal Wabbit by running:\n\n.. code-block:: bash\n\n sudo apt-get install vowpal-wabbit\n\non Debian-based systems or by using Homebrew:\n\n.. code-block:: bash\n\n brew install vowpal-wabbit\n\nYou can also build Vowpal Wabbit from source, see `instructions `_.\n\n**subwabbit** will probably work on other Pythons than 3.4+ but it is not tested\n(contribution welcomed).\n\n\nInstallation\n------------\n\n.. code-block:: bash\n\n pip install subwabbit\n\n\nExample use\n-----------\n\n\n.. code-block:: python\n\n from subwabbit import VowpalWabbitProcess, VowpalWabbitDummyFormatter\n\n vw = VowpalWabbitProcess(VowpalWabbitDummyFormatter(), ['-q', 'ab'])\n\n common_features = '|a common_feature1:1.5 common_feature2:-0.3'\n items_features = [\n '|b item123',\n '|b item456',\n '|b item789'\n ]\n\n for prediction in vw.predict(common_features, items_features, timeout=0.001):\n print(prediction)\n 0.4\n 0.5\n 0.6\n\nThis is the simplest use of *subwabbit* library. You have some common features that describe context\n- it can be location of user or daytime for example. Then there is collection of items to score, each item has\nits specific features. Use of `timeout` argument means \"compute as many predictions as you can in 1ms\", then stop.\n\nMore advanced use\n`````````````````\n\nWith simple implementation above you will not use key feature of `subwabbit`:\n**you can format your vw lines while Vowpal is busy with computing predictions**.\nBy using this trick, you can get great speedup and VW lines formatting abstraction as a bonus.\n\n\nSuppose we have features as dicts:\n\n.. code-block:: python\n\n common_features = {\n 'common_feature1': 1.5,\n 'common_feature2': -0.3\n }\n\n items_features = [\n {'id': 'item123'},\n {'id': 'item456'},\n {'id': 'item789'}\n ]\n\n\nThen implementation with use of formatter can look like this:\n\n\n.. code-block:: python\n\n from subwabbit import VowpalWabbitBaseFormatter, VowpalWabbitProcess\n\n class MyVowpalWabbitFormatter(VowpalWabbitBaseFormatter):\n\n def format_common_features(self, common_features, debug_info=None):\n return '|a ccommon_feature1:{:.2f} common_feature2:{:.2f}'.format(\n common_features['common_feature1'],\n common_features['common_feature2']\n )\n\n def format_item_features(self, common_features, item_features, debug_info=None):\n return '|b {}'.format(item_features['id'])\n\n vw = VowpalWabbitProcess(MyVowpalWabbitFormatter(), ['-q', 'ab'])\n\n for prediction in vw.predict(common_features, items_features, timeout=0.001):\n print(prediction)\n 0.4\n 0.5\n 0.6\n\n\n\nBenchmarks\n----------\n\nBenchmarks were made on logistic regression model with L2 regularization and with many quadratic combinations\nto mimic real-world use case.\nReal dataset containing 1000 contexts and 3000 items was used.\nModel was pretrained on this dataset with random labels generated. You can see used features at:\n\n- `tests/benchmarks/requests.json`\n- `tests/benchmarks/items.json`\n\n.. code-block:: bash\n\n # Prepare environment\n pip install pandas vowpalwabbit\n cd tests/benchmarks\n # benchmarks depends a lot whether Vowpal is trained or just initialized\n python pretrain_model.py\n\n # Benchmark official Python client\n python benchmark_pyvw.py\n\n # Benchmark blocking implementation\n python benchmark_blocking_implementation.py\n\n # Benchmark nonblocking implementation\n python benchmark_blocking_implementation.py\n\n\nBenchmark results\n`````````````````\nResults on Dell Latitude E7470 with Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz.\n\nTable shows how many lines implementation can predict in 10ms:\n\n+------+------------+------------------+\n| | pyvw | subwabbit |\n+======+============+==================+\n| mean | 239.461000 | 1033.70000 |\n+------+------------+------------------+\n| min | 83.000000 | 100.00000 |\n+------+------------+------------------+\n| 25% | 192.750000 | 650.00000 |\n+------+------------+------------------+\n| 50% | 240.000000 | 1000.00000 |\n+------+------------+------------------+\n| 75% | 288.000000 | 1350.00000 |\n+------+------------+------------------+\n| 90% | 316.000000 | 1600.00000 |\n+------+------------+------------------+\n| 99% | 349.000000 | 1900.00000 |\n+------+------------+------------------+\n| max | 362.000000 | 2050.00000 |\n+------+------------+------------------+\n\n**subwabbit** is in average more then **4x** faster than official Python wrapper.\n\n\nLicense\n-------\n\nCopyright (c) 2016 - 2018, Seznam.cz, a.s.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions\nare met:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.\n\n\n\n",
"description_content_type": "text/x-rst",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/jakac/subwabbit",
"keywords": "",
"license": "BSD",
"maintainer": "",
"maintainer_email": "",
"name": "subwabbit",
"package_url": "https://pypi.org/project/subwabbit/",
"platform": "",
"project_url": "https://pypi.org/project/subwabbit/",
"project_urls": {
"Homepage": "https://github.com/jakac/subwabbit"
},
"release_url": "https://pypi.org/project/subwabbit/2.0.0/",
"requires_dist": [
"mypy-lang",
"typing"
],
"requires_python": "",
"summary": "Fast Python Vowpal Wabbit wrapper",
"version": "2.0.0"
},
"last_serial": 5400671,
"releases": {
"1.0.0": [
{
"comment_text": "",
"digests": {
"md5": "65b95a8e220c1d61343a4069e2808064",
"sha256": "3aed54b0c56110aa61436a603569662de41e68193f70bc20d7fb079ec8491ae2"
},
"downloads": -1,
"filename": "subwabbit-1.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "65b95a8e220c1d61343a4069e2808064",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17883,
"upload_time": "2019-06-01T13:00:10",
"url": "https://files.pythonhosted.org/packages/39/c8/876643f71856cc2fa4231e595bbfb275f8a9cc9778f4db8a35d7635c096a/subwabbit-1.0.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "4ca1223913068c0cd35d671c46e5083d",
"sha256": "e4752c1d4a13c8fe37a3706ca835162090d1c0807deed880fb2a6dd52cb6f975"
},
"downloads": -1,
"filename": "subwabbit-1.0.0.tar.gz",
"has_sig": false,
"md5_digest": "4ca1223913068c0cd35d671c46e5083d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16872,
"upload_time": "2019-06-01T13:00:11",
"url": "https://files.pythonhosted.org/packages/e6/dd/b0e08c162c553009361f6ed073c933943c6d47e80495733c084e79755648/subwabbit-1.0.0.tar.gz"
}
],
"1.0.0a1": [
{
"comment_text": "",
"digests": {
"md5": "9efd1aa26c1c59edbc824424dfc68b4d",
"sha256": "e40210a2d34cfdd1b1fee17177c398cd4c43a2b07b77a738b7f9ac59262229a5"
},
"downloads": -1,
"filename": "subwabbit-1.0.0a1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9efd1aa26c1c59edbc824424dfc68b4d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17908,
"upload_time": "2019-06-01T12:44:22",
"url": "https://files.pythonhosted.org/packages/80/3e/2c7458f07a2eb1c6d8490bd5a7d2df9c620f9167f1ca7917d148b22ee0a7/subwabbit-1.0.0a1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "959bf60e75b8680390fc57de56963907",
"sha256": "9ec79cbe631ab89ebb89bcc9026ddad9b77ee53243c9876648c3c6c72810f63f"
},
"downloads": -1,
"filename": "subwabbit-1.0.0a1.tar.gz",
"has_sig": false,
"md5_digest": "959bf60e75b8680390fc57de56963907",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16886,
"upload_time": "2019-06-01T12:44:24",
"url": "https://files.pythonhosted.org/packages/01/16/3ac0c6fd9265739ba44cb13b7223de4c64d2482ecc0ec98309c13c5d8e6f/subwabbit-1.0.0a1.tar.gz"
}
],
"1.0.0a2": [
{
"comment_text": "",
"digests": {
"md5": "7c76044b6cf6326d332a625b56425d8a",
"sha256": "b3362d11fcb92064b9c2947cfba289057fa419d29664e08c469cc07eb975c8f8"
},
"downloads": -1,
"filename": "subwabbit-1.0.0a2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7c76044b6cf6326d332a625b56425d8a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17909,
"upload_time": "2019-06-01T12:51:50",
"url": "https://files.pythonhosted.org/packages/d4/64/cdc30f396cf23512d18e261157c76f1be801fab5fbf537815fa680689f95/subwabbit-1.0.0a2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "33809adcf784f5224012d05b6a761889",
"sha256": "b6cb11cd57ee2b0c59f4161ed44c0ee809fd1236a200d122f9a9830f0b7c926e"
},
"downloads": -1,
"filename": "subwabbit-1.0.0a2.tar.gz",
"has_sig": false,
"md5_digest": "33809adcf784f5224012d05b6a761889",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16880,
"upload_time": "2019-06-01T12:51:52",
"url": "https://files.pythonhosted.org/packages/b1/64/221e189ce9129b2d49e37ac3da9dfeb982235a50fe36bfff5629ab41f31d/subwabbit-1.0.0a2.tar.gz"
}
],
"1.0.1": [
{
"comment_text": "",
"digests": {
"md5": "19a560da5c1c3ab130f28010d2ffa049",
"sha256": "169fd3c4c9790dd65286bdf6961f1bd4d6a525f41fbd0d04286a4f45257d28f5"
},
"downloads": -1,
"filename": "subwabbit-1.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "19a560da5c1c3ab130f28010d2ffa049",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 17925,
"upload_time": "2019-06-04T14:10:36",
"url": "https://files.pythonhosted.org/packages/46/d8/5517739c44de91f21023268c8f09934234aaaaacc4023e617500a2ffac9e/subwabbit-1.0.1-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "52cb1dfb1781bafe18140d5bf4705ec1",
"sha256": "e2a40f91c734b7d95e936ed1769d4634c12ac0ab2050d85f3e7ef91c5275b055"
},
"downloads": -1,
"filename": "subwabbit-1.0.1.tar.gz",
"has_sig": false,
"md5_digest": "52cb1dfb1781bafe18140d5bf4705ec1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16915,
"upload_time": "2019-06-04T14:10:38",
"url": "https://files.pythonhosted.org/packages/88/11/789c0828b6b91e02bcda6722cb32d94c1a2752c0cd9b21fcb294f1b6ef37/subwabbit-1.0.1.tar.gz"
}
],
"1.1.0": [
{
"comment_text": "",
"digests": {
"md5": "eabe333805e8a902733d4105796aad61",
"sha256": "119b2ede962e98d6b11afcb8cbf1041f88f22097ee8a7eb2e0e50dd82176fe42"
},
"downloads": -1,
"filename": "subwabbit-1.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "eabe333805e8a902733d4105796aad61",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18048,
"upload_time": "2019-06-13T17:20:46",
"url": "https://files.pythonhosted.org/packages/9a/53/66317dbb8b921603325708d94885b55ea307775ec09cee0ca4d18475f085/subwabbit-1.1.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "b0bef70139cdc0d46fd3aa50ff2a546c",
"sha256": "034998446feb797dc2fd396de8c95436e6de12bb986f3ee846a58be66a00af97"
},
"downloads": -1,
"filename": "subwabbit-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "b0bef70139cdc0d46fd3aa50ff2a546c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17026,
"upload_time": "2019-06-13T17:20:48",
"url": "https://files.pythonhosted.org/packages/30/0e/436e229451c535eba1fd398eb1ceda45355c88a2d5f5dad8f5f03729aef8/subwabbit-1.1.0.tar.gz"
}
],
"2.0.0": [
{
"comment_text": "",
"digests": {
"md5": "34424bfd1d0fc5200fd0567a7f85ba65",
"sha256": "23376dd845e0f63d60eee96f8b32026dc0e5ea0faf84e39c629197c7a7f7b5cd"
},
"downloads": -1,
"filename": "subwabbit-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "34424bfd1d0fc5200fd0567a7f85ba65",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18154,
"upload_time": "2019-06-14T13:47:27",
"url": "https://files.pythonhosted.org/packages/48/e1/27a992eca1af3afef89f1221386602f208bc25ba1050ac2a235c2a5de565/subwabbit-2.0.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "1086fe74e13e4fc8a44d367e809c42bb",
"sha256": "b8cb024afb598656dce2e2d8db297637725a9ade952dacae58909ca650e15758"
},
"downloads": -1,
"filename": "subwabbit-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "1086fe74e13e4fc8a44d367e809c42bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17065,
"upload_time": "2019-06-14T13:47:29",
"url": "https://files.pythonhosted.org/packages/ee/99/d081c846d83e71a88702fa980078f8dc563136c5c2bde7edfeb2af32333c/subwabbit-2.0.0.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "34424bfd1d0fc5200fd0567a7f85ba65",
"sha256": "23376dd845e0f63d60eee96f8b32026dc0e5ea0faf84e39c629197c7a7f7b5cd"
},
"downloads": -1,
"filename": "subwabbit-2.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "34424bfd1d0fc5200fd0567a7f85ba65",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 18154,
"upload_time": "2019-06-14T13:47:27",
"url": "https://files.pythonhosted.org/packages/48/e1/27a992eca1af3afef89f1221386602f208bc25ba1050ac2a235c2a5de565/subwabbit-2.0.0-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "1086fe74e13e4fc8a44d367e809c42bb",
"sha256": "b8cb024afb598656dce2e2d8db297637725a9ade952dacae58909ca650e15758"
},
"downloads": -1,
"filename": "subwabbit-2.0.0.tar.gz",
"has_sig": false,
"md5_digest": "1086fe74e13e4fc8a44d367e809c42bb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 17065,
"upload_time": "2019-06-14T13:47:29",
"url": "https://files.pythonhosted.org/packages/ee/99/d081c846d83e71a88702fa980078f8dc563136c5c2bde7edfeb2af32333c/subwabbit-2.0.0.tar.gz"
}
]
}