3 releases (stable)

8.8.1+vw-v8.8.0 Feb 2, 2020
8.8.0+post3 Jan 28, 2020
8.8.0 Jan 27, 2020
8.7.0 Jun 30, 2019
8.6.1-beta Jun 2, 2019

#714 in Machine learning

MIT license

7.5MB
152K SLoC

C++ 76K SLoC // 0.2% comments C 23K SLoC // 0.2% comments Visual Studio Project 21K SLoC C# 17K SLoC // 0.2% comments Visual Studio Solution 2K SLoC Python 2K SLoC // 0.2% comments Ada 1.5K SLoC // 0.2% comments .NET Resource 1.5K SLoC // 0.2% comments GNU Style Assembly 1.5K SLoC // 0.3% comments Assembly 1.5K SLoC // 0.2% comments Shell 1K SLoC // 0.2% comments Pascal 1K SLoC // 0.2% comments Bitbake 527 SLoC Batch 273 SLoC // 0.1% comments Perl 213 SLoC // 0.2% comments NuGet Config 93 SLoC Scala 88 SLoC // 0.4% comments Rust 78 SLoC // 0.0% comments Automake 34 SLoC INI 22 SLoC Objective-C++ 2 SLoC // 0.9% comments JavaScript 2 SLoC Forge Config 2 SLoC // 0.6% comments Objective-C 2 SLoC // 0.9% comments Poke 1 SLoC

Contains (Cab file, 75KB) distribution_explorer.suo

VowpalWabbit-sys-rs

build Crates.io Docs

This crate wraps VowpalWabbit's C binding interface. This crate wraps all of the dependencies and builds from source on each platform. For details about how the dependencies are configured see here.

See vowpalwabbit-rs for the Rust wrapper around the sys package. This is still a work in progress.

The major and minor versions of this crate track that of the native VW library that is wraps. The patch version, though, may be out of sync due to the need to patch the crate out of sync with the native dependency. Starting at version 8.8.1+vw-v8.8.0 you can determine the version of Vowpal Wabbit that it wraps by looking at the associated SemVer metadata. In this case it is vw-v8.8.0 indicating the wrapped Vowpal Wabbit version is 8.8.0.

Example

The following is an example for a basic usecase similar to command line driver mode. VW is initialized, an example run through the parser then prediction pipeline. Finally the example and VW object are finished.

use std::ffi::CString;

unsafe {
  let command_line_str = CString::new("--quiet").unwrap();
  let vw_handle = vowpalwabbit_sys::VW_InitializeA(command_line_str.as_ptr());
  let example_str =
    CString::new("1 | test example=1").unwrap();
  let example_handle = vowpalwabbit_sys::VW_ReadExampleA(vw_handle, example_str.as_ptr());

  vowpalwabbit_sys::VW_Predict(vw_handle, example_handle);
  vowpalwabbit_sys::VW_Learn(vw_handle, example_handle);
  vowpalwabbit_sys::VW_FinishExample(vw_handle, example_handle);
  vowpalwabbit_sys::VW_Finish(vw_handle);
}

Dependencies