3 releases (stable)
8.8.1+vw-v8.8.0 | Feb 2, 2020 |
---|---|
8.8.0+post3 |
|
8.8.0 |
|
8.7.0 | Jun 30, 2019 |
8.6.1-beta | Jun 2, 2019 |
#919 in Machine learning
7.5MB
152K
SLoC
Contains (autotools obfuscated code, 105KB) configure, (Cab file, 75KB) distribution_explorer.suo, (obscure autoconf code, 1KB) configure.ac
VowpalWabbit-sys-rs
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);
}