Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
|ImageLink|_
.. |ImageLink| image:: https://badge.fury.io/py/vowpalwabbit.svg .. _ImageLink: https://pypi.python.org/pypi/vowpalwabbit
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.
See the installation instructions
_
You can use the python wrapper directly like this:
.. code-block:: python
>>> 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:
.. code-block:: python
>>> 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)
See the troubleshooting guide
_
Contributions are welcome for improving the python wrapper to Vowpal Wabbit.
Tests can be run using setup.py:
.. code-block:: bash
$ python setup.py test
Directory Structure:
Note: neither examples nor tests directories are included in the distributed package, they are only for development purposes.
.. _issues: https://github.com/VowpalWabbit/vowpal_wabbit/issues .. _repo: https://github.com/VowpalWabbit/vowpal_wabbit .. _pytest: http://pytest.org/latest/getting-started.html .. _tox: https://tox.readthedocs.io/en/latest/index.html .. _installation instructions: https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Python#installing .. _troubleshooting guide: https://github.com/VowpalWabbit/vowpal_wabbit/wiki/Python#troubleshooting
FAQs
Vowpal Wabbit Python package
We found that vowpalwabbit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.