Vowpal Wabbit
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
VW Namespace Reference

Namespaces

 cb_continuous
 
 cb_explore_adf
 
 config
 
 continuous_actions
 
 debug
 
 details
 
 distributionally_robust
 
 experimental
 
 io
 
 LEARNER
 Contains the VW::LEARNER::learner object and utilities for interacting with it.
 
 math
 
 model_utils
 
 parsers
 
 reductions
 
 slates
 
 version_definitions
 

Classes

struct  active_multiclass_prediction
 
struct  audit_strings
 
struct  cached_learner
 
struct  column_definition
 
struct  default_cleanup
 
struct  default_initializer
 
struct  default_reduction_stack_setup
 
struct  example
 
struct  example_predict
 
struct  flat_example
 
class  generic_range
 
class  generic_range< IteratorT, typename std::enable_if< std::is_const< IteratorT >::value >::type >
 
class  generic_range< IteratorT, typename std::enable_if<!std::is_const< IteratorT >::value >::type >
 
struct  kskip_ngram_transformer
 
struct  label_parser
 
struct  label_parser_reuse_mem
 
class  loss_function
 
struct  metric_sink
 
struct  metric_sink_visitor
 
struct  moved_object_pool
 
class  named_labels
 
struct  namespace_extent
 
struct  no_lock_object_pool
 
struct  object_pool
 
struct  polylabel
 
struct  polyprediction
 
struct  primitive_feature_space
 
class  ptr_queue
 
struct  rand_state
 
class  reduction_features
 
class  save_load_model_exception
 
struct  scored_config
 
struct  setup_base_i
 
class  SpanningTree
 
class  strict_parse_exception
 
struct  v_array
 This is a diagnostic overload used to prevent v_array from being used with types that are not trivially copyable. More...
 
struct  v_array< T, typename std::enable_if< std::is_trivially_copyable< T >::value >::type >
 v_array is a container type that makes use of realloc for efficiency. However, it is only safe to use trivially copyable types, as std::realloc may do a memcpy if a new piece of memory must be allocated. More...
 
struct  version_struct
 
class  vw_argument_disagreement_exception
 
class  vw_argument_invalid_value_exception
 
class  vw_exception
 
class  vw_unrecognised_option_exception
 
struct  workspace
 

Typedefs

using multi_ex = std::vector< example * >
 
using decision_scores_t = std::vector< ACTION_SCORE::action_scores >
 
using example_factory_t = example &(*)(void *)
 
using namespace_index = unsigned char
 
using reduction_setup_fn = VW::LEARNER::base_learner *(*)(VW::setup_base_i &)
 
template<typename T >
using v_array_pool = VW::moved_object_pool< v_array< T > >
 
template<typename T >
using vector_pool = VW::moved_object_pool< std::vector< T > >
 
using driver_output_func_t = void(*)(void *, const std::string &)
 
using string_view = nonstd::string_view
 

Enumerations

enum  cb_type_t : uint32_t {
  cb_type_t::dr, cb_type_t::dm, cb_type_t::ips, cb_type_t::mtr,
  cb_type_t::sm
}
 
enum  label_type_t : uint32_t {
  label_type_t::simple, label_type_t::cb, label_type_t::cb_eval, label_type_t::cs,
  label_type_t::multilabel, label_type_t::multiclass, label_type_t::ccb, label_type_t::slates,
  label_type_t::nolabel, label_type_t::continuous
}
 
enum  prediction_type_t : uint32_t {
  prediction_type_t::scalar, prediction_type_t::scalars, prediction_type_t::action_scores, prediction_type_t::pdf,
  prediction_type_t::action_probs, prediction_type_t::multiclass, prediction_type_t::multilabels, prediction_type_t::prob,
  prediction_type_t::multiclassprobs, prediction_type_t::decision_probs, prediction_type_t::action_pdf_value, prediction_type_t::active_multiclass,
  prediction_type_t::nopred
}
 
enum  wrap_type { wrap_type::truncate, wrap_type::truncate_with_ellipsis, wrap_type::wrap_space, wrap_type::wrap_char }
 
enum  align_type { align_type::left, align_type::right }
 

Functions

constexpr bool action_score_compare_lt (const ACTION_SCORE::action_score &left, const ACTION_SCORE::action_score &right)
 
constexpr bool action_score_compare_gt (const ACTION_SCORE::action_score &left, const ACTION_SCORE::action_score &right)
 
std::string to_string (const ACTION_SCORE::action_scores &action_scores_or_probs, int decimal_precision=DEFAULT_FLOAT_PRECISION)
 
std::string to_string (const VW::active_multiclass_prediction &active_multiclass)
 
void count_label (shared_data &sd, float l)
 
bool get_best_constant (const loss_function &loss_func, const shared_data &sd, float &best_constant, float &best_constant_loss)
 
uint32_t convert (size_t number)
 
void write_example_to_cache (io_buf &output, VW::example *ae, VW::label_parser &lbl_parser, uint64_t parse_mask, VW::details::cache_temp_buffer &temp_buffer)
 
int read_example_from_cache (VW::workspace *all, io_buf &buf, v_array< VW::example *> &examples)
 
std::string to_string (const cb_continuous::continuous_label_elm &elm, int decimal_precision=DEFAULT_FLOAT_PRECISION)
 
std::string to_string (const cb_continuous::continuous_label &lbl, int decimal_precision=DEFAULT_FLOAT_PRECISION)
 
cb_type_t cb_type_from_string (string_view str)
 
string_view to_string (cb_type_t type)
 
const char * to_string (CCB::example_type type)
 
int string_cpy (char *dest, size_t dest_size, const char *src)
 
int file_open (FILE **pf, const char *filename, const char *mode)
 
int get_pid ()
 
void print_decision_scores (VW::io::writer *f, const VW::decision_scores_t &decision_scores, VW::io::logger &logger)
 
std::string to_string (const VW::decision_scores_t &decision_scores, int decimal_precision=VW::DEFAULT_FLOAT_PRECISION)
 
void print_update_ccb (VW::workspace &all, std::vector< example *> &slots, const VW::decision_scores_t &decision_scores, size_t num_features)
 
void print_update_slates (VW::workspace &all, std::vector< example *> &slots, const VW::decision_scores_t &decision_scores, size_t num_features)
 
void copy_example_data (example *dst, const example *src)
 
void setup_example (VW::workspace &all, example *ae)
 
std::string to_string (const v_array< float > &scalars, int decimal_precision=DEFAULT_FLOAT_PRECISION)
 
flat_exampleflatten_example (VW::workspace &all, example *ec)
 
flat_exampleflatten_sort_example (VW::workspace &all, example *ec)
 
void free_flatten_example (flat_example *fec)
 
bool example_is_newline (const example &ec)
 
bool valid_ns (char c)
 
void add_passthrough_feature_magic (example &ec, uint64_t magic, uint64_t i, float x)
 
void return_multiple_example (VW::workspace &all, v_array< example *> &examples)
 
VW_STD14_CONSTEXPR float fast_pow10 (int8_t exponent)
 
std::string to_string (const audit_strings &ai)
 
template<typename T >
details::swap_guard_impl< T > swap_guard (T &original_location, T &value_to_swap) noexcept
 
template<typename T >
details::swap_guard_impl_rvalue< T > swap_guard (T &original_location, T &&value_to_swap) noexcept
 
template<typename T >
details::swap_guard_impl_rvalue< T > stash_guard (T &original_location) noexcept
 
label_parser get_label_parser (VW::label_type_t label_type)
 
string_view to_string (VW::label_type_t)
 
std::unique_ptr< loss_functionget_loss_function (VW::workspace &, const std::string &funcName, float function_parameter=0)
 
template<typename T , typename... Args>
std::unique_ptr< T > make_unique (Args &&... params)
 
std::string to_string (const MULTILABEL::labels &multilabels)
 
template<typename RetType , typename InputType >
RetType cast_to_smaller_type (InputType input)
 
template<typename RetType , typename InputType >
RetType cast_signed_to_unsigned (InputType input)
 
exampleget_unused_example (VW::workspace *all)
 
void read_line (VW::workspace &all, example *ex, const char *line)
 
void read_lines (VW::workspace *all, const char *line, size_t len, v_array< example *> &examples)
 
template<bool audit>
void read_line_json_s (const VW::label_parser &lbl_parser, hash_func_t hash_func, uint64_t hash_seed, uint64_t parse_mask, bool chain_hash, VW::label_parser_reuse_mem *reuse_mem, const VW::named_labels *ldict, VW::v_array< VW::example *> &examples, char *line, size_t length, example_factory_t example_factory, void *ex_factory_context, VW::io::logger &logger, std::unordered_map< uint64_t, VW::example *> *dedup_examples=nullptr)
 
template<bool audit>
void read_line_json_s (VW::workspace &all, VW::v_array< VW::example *> &examples, char *line, size_t length, example_factory_t example_factory, void *ex_factory_context, std::unordered_map< uint64_t, VW::example *> *dedup_examples=nullptr)
 
bool apply_pdrop (label_type_t label_type, float pdrop, VW::v_array< VW::example *> &examples, VW::io::logger &logger)
 
template<bool audit>
bool read_line_decision_service_json (VW::workspace &all, VW::v_array< VW::example *> &examples, char *line, size_t length, bool copy_line, example_factory_t example_factory, void *ex_factory_context, DecisionServiceInteraction *data)
 
std::string trim_whitespace (const std::string &s)
 
VW::string_view trim_whitespace (VW::string_view str)
 
std::vector< std::string > split_command_line (const std::string &cmd_line)
 
std::vector< std::string > split_command_line (VW::string_view cmd_line)
 
std::vector< VW::string_viewsplit_by_limit (const VW::string_view &s, size_t limit)
 
void parse_example_label (string_view label, const VW::label_parser &lbl_parser, const named_labels *ldict, label_parser_reuse_mem &reuse_mem, example &ec, VW::io::logger &logger)
 
void setup_examples (VW::workspace &all, v_array< example *> &examples)
 
string_view to_string (prediction_type_t)
 
std::string to_string (const continuous_actions::probability_density_function_value &pdf_value, int decimal_precision=DEFAULT_FLOAT_PRECISION)
 
std::string to_string (const continuous_actions::probability_density_function &pdf, int decimal_precision=DEFAULT_FLOAT_PRECISION)
 
template<>
CCB::reduction_featuresreduction_features::get< CCB::reduction_features > ()
 
template<>
const CCB::reduction_featuresreduction_features::get< CCB::reduction_features > () const
 
template<>
VW::continuous_actions::reduction_featuresreduction_features::get< VW::continuous_actions::reduction_features > ()
 
template<>
const VW::continuous_actions::reduction_featuresreduction_features::get< VW::continuous_actions::reduction_features > () const
 
template<>
VW::cb_explore_adf::greedy::reduction_featuresreduction_features::get< VW::cb_explore_adf::greedy::reduction_features > ()
 
template<>
const VW::cb_explore_adf::greedy::reduction_featuresreduction_features::get< VW::cb_explore_adf::greedy::reduction_features > () const
 
VW::string_view to_string (reductions::automl::automl_state state)
 
VW::string_view to_string (reductions::automl::config_state state)
 
template<typename TScopeExitLambda >
details::scope_exit_caller< TScopeExitLambda > scope_exit (TScopeExitLambda &&lambda) noexcept
 
VW::string_view to_string (VW::slates::example_type)
 
template<size_t num_cols>
void format_row (const std::array< std::string, num_cols > &contents, const std::array< column_definition, num_cols > &column_definitions, size_t column_padding, std::ostream &output)
 
template<size_t num_cols>
std::string format_row (const std::array< std::string, num_cols > &contents, const std::array< column_definition, num_cols > &column_definitions, size_t column_padding)
 
bool try_extract_random_seed (const VW::example &ex, VW::string_view &view)
 
bool ends_with (VW::string_view full_string, VW::string_view ending)
 Check if a string ends with some other string. More...
 
bool starts_with (VW::string_view full_string, VW::string_view starting)
 Check if a string starts with some other string. More...
 
std::string decode_inline_hex (VW::string_view arg, VW::io::logger &logger)
 Replace hex sequences in a string with their corresponding byte. A hex sequence must only contain two digits and must be in the form . More...
 
std::string wrap_text (VW::string_view text, size_t width, bool wrap_after=true)
 Wrap text by whole words with the given column width. More...
 
std::string fmt_float (float f, int max_decimal_places)
 Format float to string with max number of digits after the decimal place. More...
 
constexpr version_struct version (VW_VERSION_MAJOR, VW_VERSION_MINOR, VW_VERSION_PATCH)
 
VW::workspaceinitialize (std::unique_ptr< config::options_i, options_deleter_type > options, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr)
 
VW::workspaceinitialize (config::options_i &options, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr)
 
VW::workspaceinitialize (const std::string &s, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr)
 
VW::workspaceinitialize (int argc, char *argv[], io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr)
 
VW::workspaceseed_vw_model (VW::workspace *vw_model, const std::string &extra_args, trace_message_t trace_listener=nullptr, void *trace_context=nullptr)
 
VW::workspaceinitialize_escaped (std::string const &s, io_buf *model=nullptr, bool skip_model_load=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr)
 
VW::workspaceinitialize_with_builder (const std::string &s, io_buf *model=nullptr, bool skipModelLoad=false, trace_message_t trace_listener=nullptr, void *trace_context=nullptr, std::unique_ptr< VW::setup_base_i >=nullptr)
 
VW_WARNING_STATE_PUSH VW_WARNING_DISABLE_BADLY_FORMED_XML std::unique_ptr< VW::workspaceinitialize_experimental (std::unique_ptr< config::options_i > options, std::unique_ptr< VW::io::reader > model_override_reader=nullptr, driver_output_func_t driver_output_func=nullptr, void *driver_output_func_context=nullptr, VW::io::logger_output_func_t logger_output_func=nullptr, void *logger_output_func_context=nullptr, std::unique_ptr< VW::setup_base_i > setup_base=nullptr)
 Initialize a workspace. This interface is currently experimental, but will replace the existing array of initialize functions. More...
 
VW_WARNING_STATE_POP void cmd_string_replace_value (std::stringstream *&ss, std::string flag_to_replace, const std::string &new_value)
 
char ** to_argv (std::string const &s, int &argc)
 
char ** to_argv_escaped (std::string const &s, int &argc)
 
void free_args (int argc, char *argv[])
 
const char * are_features_compatible (VW::workspace &vw1, VW::workspace &vw2)
 
VW_WARNING_STATE_PUSH VW_WARNING_DISABLE_BADLY_FORMED_XML void finish (VW::workspace &all, bool delete_all=true)
 Call finish() after you are done with the vw instance. This cleans up memory usage if delete_all is true. Finish will cause final stat printouts and model serialization to occur. IMPORTANT: If lifetime is managed by a unique_ptr from initialize_experimental, then you must call this with delete_all = false. More...
 
VW_WARNING_STATE_POP void sync_stats (VW::workspace &all)
 
void start_parser (VW::workspace &all)
 
void end_parser (VW::workspace &all)
 
bool is_ring_example (const VW::workspace &all, const example *ae)
 
exampleread_example (VW::workspace &all, const char *example_line)
 
exampleread_example (VW::workspace &all, const std::string &example_line)
 
exampleimport_example (VW::workspace &all, const std::string &label, primitive_feature_space *features, size_t len)
 
examplealloc_examples (size_t count)
 
void dealloc_examples (example *example_ptr, size_t count)
 
void parse_example_label (VW::workspace &all, example &ec, const std::string &label)
 
examplenew_unused_example (VW::workspace &all)
 
exampleget_example (parser *pf)
 
float get_topic_prediction (example *ec, size_t i)
 
float get_label (example *ec)
 
float get_importance (example *ec)
 
float get_initial (example *ec)
 
float get_prediction (example *ec)
 
float get_cost_sensitive_prediction (example *ec)
 
v_array< float > & get_cost_sensitive_prediction_confidence_scores (example *ec)
 
uint32_t * get_multilabel_predictions (example *ec, size_t &len)
 
float get_action_score (example *ec, size_t i)
 
size_t get_action_score_length (example *ec)
 
size_t get_tag_length (example *ec)
 
const char * get_tag (example *ec)
 
size_t get_feature_number (example *ec)
 
float get_confidence (example *ec)
 
featureget_features (VW::workspace &all, example *ec, size_t &feature_number)
 
void return_features (feature *f)
 
void add_constant_feature (VW::workspace &all, example *ec)
 
void add_label (example *ec, float label, float weight=1, float base=0)
 
void finish_example (VW::workspace &all, example &ec)
 
void finish_example (VW::workspace &all, multi_ex &ec)
 
void empty_example (VW::workspace &all, example &ec)
 
void move_feature_namespace (example *dst, example *src, namespace_index c)
 
void copy_example_metadata (example *, const example *)
 
void copy_example_data_with_label (example *dst, const example *src)
 
primitive_feature_spaceexport_example (VW::workspace &all, example *e, size_t &len)
 
void releaseFeatureSpace (primitive_feature_space *features, size_t len)
 
void save_predictor (VW::workspace &all, const std::string &reg_name)
 
void save_predictor (VW::workspace &all, io_buf &buf)
 
uint64_t hash_space (VW::workspace &all, const std::string &s)
 
uint64_t hash_space_static (const std::string &s, const std::string &hash)
 
uint64_t hash_space_cstr (VW::workspace &all, const char *fstr)
 
uint64_t hash_feature (VW::workspace &all, const std::string &s, uint64_t u)
 
uint64_t hash_feature_static (const std::string &s, uint64_t u, const std::string &h, uint32_t num_bits)
 
uint64_t hash_feature_cstr (VW::workspace &all, const char *fstr, uint64_t u)
 
uint64_t chain_hash (VW::workspace &all, const std::string &name, const std::string &value, uint64_t u)
 
uint64_t chain_hash_static (const std::string &name, const std::string &value, uint64_t u, hash_func_t hash_func, uint64_t parse_mask)
 
float get_weight (VW::workspace &all, uint32_t index, uint32_t offset)
 
void set_weight (VW::workspace &all, uint32_t index, uint32_t offset, float value)
 
uint32_t num_weights (VW::workspace &all)
 
uint32_t get_stride (VW::workspace &all)
 
void init_features (primitive_feature_space &fs, size_t features_count)
 
void set_feature (primitive_feature_space &fs, size_t index, uint64_t feature_hash, float value)
 
std::string strerror_to_string (int error_number)
 
void validate_version (VW::workspace &all)
 
void validate_min_max_label (VW::workspace &all)
 
void validate_default_bits (VW::workspace &all, uint32_t local_num_bits)
 
void validate_num_bits (VW::workspace &all)
 
VW_STD14_CONSTEXPR uint64_t uniform_hash (const void *key, size_t len, uint64_t seed)
 

Variables

static constexpr const int DEFAULT_FLOAT_PRECISION = 6
 
static constexpr const int DEFAULT_FLOAT_FORMATTING_DECIMAL_PRECISION = 2
 
const std::string git_commit
 

Typedef Documentation

◆ decision_scores_t

using VW::decision_scores_t = typedef std::vector<ACTION_SCORE::action_scores>

◆ driver_output_func_t

using VW::driver_output_func_t = typedef void (*)(void*, const std::string&)

◆ example_factory_t

using VW::example_factory_t = typedef example& (*)(void*)

◆ multi_ex

typedef std::vector< example * > VW::multi_ex

◆ namespace_index

typedef unsigned char VW::namespace_index

◆ reduction_setup_fn

using VW::reduction_setup_fn = typedef VW::LEARNER::base_learner* (*)(VW::setup_base_i&)

◆ string_view

using VW::string_view = typedef nonstd::string_view

◆ v_array_pool

template<typename T >
using VW::v_array_pool = typedef VW::moved_object_pool<v_array<T> >

◆ vector_pool

template<typename T >
using VW::vector_pool = typedef VW::moved_object_pool<std::vector<T> >

Enumeration Type Documentation

◆ align_type

enum VW::align_type
strong
Enumerator
left 
right 

◆ cb_type_t

enum VW::cb_type_t : uint32_t
strong
Enumerator
dr 
dm 
ips 
mtr 
sm 

◆ label_type_t

enum typedef VW::prediction_type_t VW::label_type_t
strong
Enumerator
simple 
cb 
cb_eval 
cs 
multilabel 
multiclass 
ccb 
slates 
nolabel 
continuous 

◆ prediction_type_t

enum VW::prediction_type_t : uint32_t
strong
Enumerator
scalar 
scalars 
action_scores 
pdf 
action_probs 
multiclass 
multilabels 
prob 
multiclassprobs 
decision_probs 
action_pdf_value 
active_multiclass 
nopred 

◆ wrap_type

enum VW::wrap_type
strong
Enumerator
truncate 
truncate_with_ellipsis 
wrap_space 
wrap_char 

Function Documentation

◆ action_score_compare_gt()

constexpr bool VW::action_score_compare_gt ( const ACTION_SCORE::action_score left,
const ACTION_SCORE::action_score right 
)
inline

◆ action_score_compare_lt()

constexpr bool VW::action_score_compare_lt ( const ACTION_SCORE::action_score left,
const ACTION_SCORE::action_score right 
)
inline

◆ add_constant_feature()

void VW::add_constant_feature ( VW::workspace all,
example ec 
)

◆ add_label()

void VW::add_label ( example ec,
float  label,
float  weight = 1,
float  base = 0 
)

◆ add_passthrough_feature_magic()

void VW::add_passthrough_feature_magic ( example ec,
uint64_t  magic,
uint64_t  i,
float  x 
)
inline

◆ alloc_examples()

example* VW::alloc_examples ( size_t  count)

◆ apply_pdrop()

bool VW::apply_pdrop ( label_type_t  label_type,
float  pdrop,
VW::v_array< VW::example *> &  examples,
VW::io::logger logger 
)
inline

◆ are_features_compatible()

const char* VW::are_features_compatible ( VW::workspace vw1,
VW::workspace vw2 
)

◆ cast_signed_to_unsigned()

template<typename RetType , typename InputType >
RetType VW::cast_signed_to_unsigned ( InputType  input)

◆ cast_to_smaller_type()

template<typename RetType , typename InputType >
RetType VW::cast_to_smaller_type ( InputType  input)

◆ cb_type_from_string()

cb_type_t VW::cb_type_from_string ( string_view  str)

◆ chain_hash()

uint64_t VW::chain_hash ( VW::workspace all,
const std::string &  name,
const std::string &  value,
uint64_t  u 
)
inline

◆ chain_hash_static()

uint64_t VW::chain_hash_static ( const std::string &  name,
const std::string &  value,
uint64_t  u,
hash_func_t  hash_func,
uint64_t  parse_mask 
)
inline

◆ cmd_string_replace_value()

VW_WARNING_STATE_POP void VW::cmd_string_replace_value ( std::stringstream *&  ss,
std::string  flag_to_replace,
const std::string &  new_value 
)

◆ convert()

uint32_t VW::convert ( size_t  number)

◆ copy_example_data()

void VW::copy_example_data ( example dst,
const example src 
)

◆ copy_example_data_with_label()

void VW::copy_example_data_with_label ( example dst,
const example src 
)

◆ copy_example_metadata()

void VW::copy_example_metadata ( example ,
const example  
)

◆ count_label()

void VW::count_label ( shared_data sd,
float  l 
)
inline

◆ dealloc_examples()

void VW::dealloc_examples ( example example_ptr,
size_t  count 
)

◆ decode_inline_hex()

std::string VW::decode_inline_hex ( VW::string_view  arg,
VW::io::logger logger 
)

Replace hex sequences in a string with their corresponding byte. A hex sequence must only contain two digits and must be in the form .

Parameters
argString to replace hex values within
Returns
A copy of the original string with hex values replaced with corresponding byte.

◆ empty_example()

void VW::empty_example ( VW::workspace all,
example ec 
)

◆ end_parser()

void VW::end_parser ( VW::workspace all)

◆ ends_with()

bool VW::ends_with ( VW::string_view  full_string,
VW::string_view  ending 
)

Check if a string ends with some other string.

Parameters
full_stringString to check ending of
endingEnding value to check
Returns
true if full_string ends with ending, otherwise false.

◆ example_is_newline()

bool VW::example_is_newline ( const example ec)
inline

◆ export_example()

primitive_feature_space* VW::export_example ( VW::workspace all,
example e,
size_t &  len 
)

◆ fast_pow10()

VW_STD14_CONSTEXPR float VW::fast_pow10 ( int8_t  exponent)
inline

◆ file_open()

int VW::file_open ( FILE **  pf,
const char *  filename,
const char *  mode 
)

◆ finish()

VW_WARNING_STATE_PUSH VW_WARNING_DISABLE_BADLY_FORMED_XML void VW::finish ( VW::workspace all,
bool  delete_all = true 
)

Call finish() after you are done with the vw instance. This cleans up memory usage if delete_all is true. Finish will cause final stat printouts and model serialization to occur. IMPORTANT: If lifetime is managed by a unique_ptr from initialize_experimental, then you must call this with delete_all = false.

Parameters
allworkspace to be finished
delete_allwhethere to also also call delete on this instance.

◆ finish_example() [1/2]

void VW::finish_example ( VW::workspace all,
example ec 
)

◆ finish_example() [2/2]

void VW::finish_example ( VW::workspace all,
multi_ex ec 
)

◆ flatten_example()

flat_example* VW::flatten_example ( VW::workspace all,
example ec 
)
inline

◆ flatten_sort_example()

flat_example* VW::flatten_sort_example ( VW::workspace all,
example ec 
)
inline

◆ fmt_float()

std::string VW::fmt_float ( float  f,
int  max_decimal_places 
)

Format float to string with max number of digits after the decimal place.

Parameters
ffloat to format
max_decimal_placesif >=0 the max number of digits after decimal place. If <0, then as many digits are needed to represent the number will be used
Returns
std::string formatted float

◆ format_row() [1/2]

template<size_t num_cols>
void VW::format_row ( const std::array< std::string, num_cols > &  contents,
const std::array< column_definition, num_cols > &  column_definitions,
size_t  column_padding,
std::ostream &  output 
)

◆ format_row() [2/2]

template<size_t num_cols>
std::string VW::format_row ( const std::array< std::string, num_cols > &  contents,
const std::array< column_definition, num_cols > &  column_definitions,
size_t  column_padding 
)

◆ free_args()

void VW::free_args ( int  argc,
char *  argv[] 
)

◆ free_flatten_example()

void VW::free_flatten_example ( flat_example fec)
inline

◆ get_action_score()

float VW::get_action_score ( example ec,
size_t  i 
)

◆ get_action_score_length()

size_t VW::get_action_score_length ( example ec)

◆ get_best_constant()

bool VW::get_best_constant ( const loss_function loss_func,
const shared_data sd,
float &  best_constant,
float &  best_constant_loss 
)

◆ get_confidence()

float VW::get_confidence ( example ec)

◆ get_cost_sensitive_prediction()

float VW::get_cost_sensitive_prediction ( example ec)

◆ get_cost_sensitive_prediction_confidence_scores()

v_array<float>& VW::get_cost_sensitive_prediction_confidence_scores ( example ec)

◆ get_example()

example* VW::get_example ( parser pf)

◆ get_feature_number()

size_t VW::get_feature_number ( example ec)

◆ get_features()

feature* VW::get_features ( VW::workspace all,
example ec,
size_t &  feature_number 
)

◆ get_importance()

float VW::get_importance ( example ec)

◆ get_initial()

float VW::get_initial ( example ec)

◆ get_label()

float VW::get_label ( example ec)

◆ get_label_parser()

label_parser VW::get_label_parser ( VW::label_type_t  label_type)

◆ get_loss_function()

std::unique_ptr<loss_function> VW::get_loss_function ( VW::workspace ,
const std::string &  funcName,
float  function_parameter = 0 
)

◆ get_multilabel_predictions()

uint32_t* VW::get_multilabel_predictions ( example ec,
size_t &  len 
)

◆ get_pid()

int VW::get_pid ( )

◆ get_prediction()

float VW::get_prediction ( example ec)

◆ get_stride()

uint32_t VW::get_stride ( VW::workspace all)
inline

◆ get_tag()

const char* VW::get_tag ( example ec)

◆ get_tag_length()

size_t VW::get_tag_length ( example ec)

◆ get_topic_prediction()

float VW::get_topic_prediction ( example ec,
size_t  i 
)

◆ get_unused_example()

example& VW::get_unused_example ( VW::workspace all)

◆ get_weight()

float VW::get_weight ( VW::workspace all,
uint32_t  index,
uint32_t  offset 
)
inline

◆ hash_feature()

uint64_t VW::hash_feature ( VW::workspace all,
const std::string &  s,
uint64_t  u 
)
inline

◆ hash_feature_cstr()

uint64_t VW::hash_feature_cstr ( VW::workspace all,
const char *  fstr,
uint64_t  u 
)
inline

◆ hash_feature_static()

uint64_t VW::hash_feature_static ( const std::string &  s,
uint64_t  u,
const std::string &  h,
uint32_t  num_bits 
)
inline

◆ hash_space()

uint64_t VW::hash_space ( VW::workspace all,
const std::string &  s 
)
inline

◆ hash_space_cstr()

uint64_t VW::hash_space_cstr ( VW::workspace all,
const char *  fstr 
)
inline

◆ hash_space_static()

uint64_t VW::hash_space_static ( const std::string &  s,
const std::string &  hash 
)
inline

◆ import_example()

example* VW::import_example ( VW::workspace all,
const std::string &  label,
primitive_feature_space features,
size_t  len 
)

◆ init_features()

void VW::init_features ( primitive_feature_space fs,
size_t  features_count 
)
inline

◆ initialize() [1/4]

VW::workspace* VW::initialize ( std::unique_ptr< config::options_i, options_deleter_type options,
io_buf model = nullptr,
bool  skip_model_load = false,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr 
)

◆ initialize() [2/4]

VW::workspace* VW::initialize ( config::options_i options,
io_buf model = nullptr,
bool  skip_model_load = false,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr 
)

◆ initialize() [3/4]

VW::workspace* VW::initialize ( const std::string &  s,
io_buf model = nullptr,
bool  skip_model_load = false,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr 
)

◆ initialize() [4/4]

VW::workspace* VW::initialize ( int  argc,
char *  argv[],
io_buf model = nullptr,
bool  skip_model_load = false,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr 
)

◆ initialize_escaped()

VW::workspace* VW::initialize_escaped ( std::string const &  s,
io_buf model = nullptr,
bool  skip_model_load = false,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr 
)

◆ initialize_experimental()

VW_WARNING_STATE_PUSH VW_WARNING_DISABLE_BADLY_FORMED_XML std::unique_ptr<VW::workspace> VW::initialize_experimental ( std::unique_ptr< config::options_i options,
std::unique_ptr< VW::io::reader model_override_reader = nullptr,
driver_output_func_t  driver_output_func = nullptr,
void *  driver_output_func_context = nullptr,
VW::io::logger_output_func_t  logger_output_func = nullptr,
void *  logger_output_func_context = nullptr,
std::unique_ptr< VW::setup_base_i setup_base = nullptr 
)

Initialize a workspace. This interface is currently experimental, but will replace the existing array of initialize functions.

Parameters
optionsThe options to initialize the workspace with. Usually an instance of VW::config::options_cli.
model_override_readeroptional reading source to read the model from. Will override any model specified on the command line.
driver_output_funcoptional function to forward driver ouput to
driver_output_func_contextcontext for driver_output_func
logger_output_funcoptional function to forward logger ouput to
logger_output_func_contextcontext for logger_output_func
setup_baseoptional advanced override of reduction stack
Returns
std::unique_ptr<VW::workspace> initialized workspace

◆ initialize_with_builder()

VW::workspace* VW::initialize_with_builder ( const std::string &  s,
io_buf model = nullptr,
bool  skipModelLoad = false,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr,
std::unique_ptr< VW::setup_base_i = nullptr 
)

◆ is_ring_example()

bool VW::is_ring_example ( const VW::workspace all,
const example ae 
)

◆ make_unique()

template<typename T , typename... Args>
std::unique_ptr<T> VW::make_unique ( Args &&...  params)

◆ move_feature_namespace()

void VW::move_feature_namespace ( example dst,
example src,
namespace_index  c 
)

◆ new_unused_example()

example* VW::new_unused_example ( VW::workspace all)

◆ num_weights()

uint32_t VW::num_weights ( VW::workspace all)
inline

◆ parse_example_label() [1/2]

void VW::parse_example_label ( string_view  label,
const VW::label_parser lbl_parser,
const named_labels ldict,
label_parser_reuse_mem reuse_mem,
example ec,
VW::io::logger logger 
)

◆ parse_example_label() [2/2]

void VW::parse_example_label ( VW::workspace all,
example ec,
const std::string &  label 
)

◆ print_decision_scores()

void VW::print_decision_scores ( VW::io::writer f,
const VW::decision_scores_t decision_scores,
VW::io::logger logger 
)

◆ print_update_ccb()

void VW::print_update_ccb ( VW::workspace all,
std::vector< example *> &  slots,
const VW::decision_scores_t decision_scores,
size_t  num_features 
)

◆ print_update_slates()

void VW::print_update_slates ( VW::workspace all,
std::vector< example *> &  slots,
const VW::decision_scores_t decision_scores,
size_t  num_features 
)

◆ read_example() [1/2]

example* VW::read_example ( VW::workspace all,
const char *  example_line 
)

◆ read_example() [2/2]

example* VW::read_example ( VW::workspace all,
const std::string &  example_line 
)

◆ read_example_from_cache()

int VW::read_example_from_cache ( VW::workspace all,
io_buf buf,
v_array< VW::example *> &  examples 
)

◆ read_line()

void VW::read_line ( VW::workspace all,
example ex,
const char *  line 
)

◆ read_line_decision_service_json()

template<bool audit>
bool VW::read_line_decision_service_json ( VW::workspace all,
VW::v_array< VW::example *> &  examples,
char *  line,
size_t  length,
bool  copy_line,
example_factory_t  example_factory,
void *  ex_factory_context,
DecisionServiceInteraction data 
)

◆ read_line_json_s() [1/2]

template<bool audit>
void VW::read_line_json_s ( const VW::label_parser lbl_parser,
hash_func_t  hash_func,
uint64_t  hash_seed,
uint64_t  parse_mask,
bool  chain_hash,
VW::label_parser_reuse_mem reuse_mem,
const VW::named_labels ldict,
VW::v_array< VW::example *> &  examples,
char *  line,
size_t  length,
example_factory_t  example_factory,
void *  ex_factory_context,
VW::io::logger logger,
std::unordered_map< uint64_t, VW::example *> *  dedup_examples = nullptr 
)

◆ read_line_json_s() [2/2]

template<bool audit>
void VW::read_line_json_s ( VW::workspace all,
VW::v_array< VW::example *> &  examples,
char *  line,
size_t  length,
example_factory_t  example_factory,
void *  ex_factory_context,
std::unordered_map< uint64_t, VW::example *> *  dedup_examples = nullptr 
)

◆ read_lines()

void VW::read_lines ( VW::workspace all,
const char *  line,
size_t  len,
v_array< example *> &  examples 
)

◆ reduction_features::get< CCB::reduction_features >() [1/2]

◆ reduction_features::get< CCB::reduction_features >() [2/2]

◆ reduction_features::get< VW::cb_explore_adf::greedy::reduction_features >() [1/2]

◆ reduction_features::get< VW::cb_explore_adf::greedy::reduction_features >() [2/2]

◆ reduction_features::get< VW::continuous_actions::reduction_features >() [1/2]

◆ reduction_features::get< VW::continuous_actions::reduction_features >() [2/2]

◆ releaseFeatureSpace()

void VW::releaseFeatureSpace ( primitive_feature_space features,
size_t  len 
)

◆ return_features()

void VW::return_features ( feature f)

◆ return_multiple_example()

void VW::return_multiple_example ( VW::workspace all,
v_array< example *> &  examples 
)

◆ save_predictor() [1/2]

void VW::save_predictor ( VW::workspace all,
const std::string &  reg_name 
)

◆ save_predictor() [2/2]

void VW::save_predictor ( VW::workspace all,
io_buf buf 
)

◆ scope_exit()

template<typename TScopeExitLambda >
details::scope_exit_caller<TScopeExitLambda> VW::scope_exit ( TScopeExitLambda &&  lambda)
inlinenoexcept

Created an RAII object which executes the provided lambda when the scope exits. The primary use case is to handle cleanup in code where exceptions are possible but the code is not exception safe.

#### Example:

{
auto* resource = /* some_resource_that_needs_cleanup */;
auto guard = VW::scope_exit([resource]() { /* cleanup_resource(resource); */ });
}
// Lambda has executed at this point.

◆ seed_vw_model()

VW::workspace* VW::seed_vw_model ( VW::workspace vw_model,
const std::string &  extra_args,
trace_message_t  trace_listener = nullptr,
void *  trace_context = nullptr 
)

◆ set_feature()

void VW::set_feature ( primitive_feature_space fs,
size_t  index,
uint64_t  feature_hash,
float  value 
)
inline

◆ set_weight()

void VW::set_weight ( VW::workspace all,
uint32_t  index,
uint32_t  offset,
float  value 
)
inline

◆ setup_example()

void VW::setup_example ( VW::workspace all,
example ae 
)

◆ setup_examples()

void VW::setup_examples ( VW::workspace all,
v_array< example *> &  examples 
)

◆ split_by_limit()

std::vector<VW::string_view> VW::split_by_limit ( const VW::string_view s,
size_t  limit 
)

◆ split_command_line() [1/2]

std::vector<std::string> VW::split_command_line ( const std::string &  cmd_line)

◆ split_command_line() [2/2]

std::vector<std::string> VW::split_command_line ( VW::string_view  cmd_line)

◆ start_parser()

void VW::start_parser ( VW::workspace all)

◆ starts_with()

bool VW::starts_with ( VW::string_view  full_string,
VW::string_view  starting 
)

Check if a string starts with some other string.

Parameters
full_stringString to check starting of
startingStarting value to check
Returns
true if full_string starts with starting, otherwise false.

◆ stash_guard()

template<typename T >
details::swap_guard_impl_rvalue<T> VW::stash_guard ( T &  original_location)
inlinenoexcept

This guard will replace the location with a default constructed object on creation and upon deletion swap the original value back. This guard is equivalent to swap_guard<T>(xxx, T())

#### Example:

void use_widget(widget& my_widget)
{
auto new_widget_value = ::get_new_widget_value();
auto temp = std::move(my_widget.value);
my_widget.value = std::move(new_widget_value);
do_thing_with_widget(my_widget);
new_widget_value = std::move(my_widget.value);
my_widget.value = std::move(temp);
}
// Can be replaced with:
void use_widget(widget& my_widget)
{
auto guard = VW::swap_guard(my_widget.value, ::get_new_widget_value(););
do_thing_with_widget(my_widget);
}

◆ strerror_to_string()

std::string VW::strerror_to_string ( int  error_number)
inline

◆ string_cpy()

int VW::string_cpy ( char *  dest,
size_t  dest_size,
const char *  src 
)

◆ swap_guard() [1/2]

template<typename T >
details::swap_guard_impl<T> VW::swap_guard ( T &  original_location,
T &  value_to_swap 
)
inlinenoexcept

This guard will swap the two locations on creation and upon deletion swap them back.

#### Example:

void use_widget(widget& my_widget)
{
auto new_widget_value = ::get_new_widget_value();
auto temp = std::move(my_widget.value);
my_widget.value = std::move(new_widget_value);
do_thing_with_widget(my_widget);
new_widget_value = std::move(my_widget.value);
my_widget.value = std::move(temp);
}
// Can be replaced with:
void use_widget(widget& my_widget)
{
auto new_widget_value = ::get_new_widget_value();
auto guard = VW::swap_guard(my_widget.value, new_widget_value);
do_thing_with_widget(my_widget);
}

◆ swap_guard() [2/2]

template<typename T >
details::swap_guard_impl_rvalue<T> VW::swap_guard ( T &  original_location,
T &&  value_to_swap 
)
inlinenoexcept

This guard will swap the two locations on creation and upon deletion swap them back. Note: This overload allows for a temporary value to be passed in.

#### Example:

void use_widget(widget& my_widget)
{
auto new_widget_value = ::get_new_widget_value();
auto temp = std::move(my_widget.value);
my_widget.value = std::move(new_widget_value);
do_thing_with_widget(my_widget);
new_widget_value = std::move(my_widget.value);
my_widget.value = std::move(temp);
}
// Can be replaced with:
void use_widget(widget& my_widget)
{
auto guard = VW::swap_guard(my_widget.value, ::get_new_widget_value(););
do_thing_with_widget(my_widget);
}

◆ sync_stats()

VW_WARNING_STATE_POP void VW::sync_stats ( VW::workspace all)

◆ to_argv()

char** VW::to_argv ( std::string const &  s,
int &  argc 
)

◆ to_argv_escaped()

char** VW::to_argv_escaped ( std::string const &  s,
int &  argc 
)

◆ to_string() [1/17]

std::string VW::to_string ( const VW::active_multiclass_prediction active_multiclass)
inline

◆ to_string() [2/17]

string_view VW::to_string ( cb_type_t  type)

◆ to_string() [3/17]

string_view VW::to_string ( VW::label_type_t  )

◆ to_string() [4/17]

string_view VW::to_string ( prediction_type_t  )

◆ to_string() [5/17]

const char* VW::to_string ( CCB::example_type  type)

◆ to_string() [6/17]

std::string VW::to_string ( const MULTILABEL::labels multilabels)

◆ to_string() [7/17]

std::string VW::to_string ( const VW::decision_scores_t decision_scores,
int  decimal_precision = VW::DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [8/17]

std::string VW::to_string ( const cb_continuous::continuous_label_elm elm,
int  decimal_precision = DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [9/17]

std::string VW::to_string ( const cb_continuous::continuous_label lbl,
int  decimal_precision = DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [10/17]

std::string VW::to_string ( const continuous_actions::probability_density_function_value pdf_value,
int  decimal_precision = DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [11/17]

std::string VW::to_string ( const continuous_actions::probability_density_function pdf,
int  decimal_precision = DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [12/17]

std::string VW::to_string ( const audit_strings ai)
inline

◆ to_string() [13/17]

◆ to_string() [14/17]

std::string VW::to_string ( const v_array< float > &  scalars,
int  decimal_precision = DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [15/17]

std::string VW::to_string ( const ACTION_SCORE::action_scores action_scores_or_probs,
int  decimal_precision = DEFAULT_FLOAT_PRECISION 
)

◆ to_string() [16/17]

◆ to_string() [17/17]

◆ trim_whitespace() [1/2]

std::string VW::trim_whitespace ( const std::string &  s)

◆ trim_whitespace() [2/2]

VW::string_view VW::trim_whitespace ( VW::string_view  str)

◆ try_extract_random_seed()

bool VW::try_extract_random_seed ( const VW::example ex,
VW::string_view view 
)

◆ uniform_hash()

VW_STD14_CONSTEXPR uint64_t VW::uniform_hash ( const void *  key,
size_t  len,
uint64_t  seed 
)
inline

◆ valid_ns()

bool VW::valid_ns ( char  c)
inline

◆ validate_default_bits()

void VW::validate_default_bits ( VW::workspace all,
uint32_t  local_num_bits 
)

◆ validate_min_max_label()

void VW::validate_min_max_label ( VW::workspace all)

◆ validate_num_bits()

void VW::validate_num_bits ( VW::workspace all)

◆ validate_version()

void VW::validate_version ( VW::workspace all)

◆ version()

constexpr version_struct VW::version ( VW_VERSION_MAJOR  ,
VW_VERSION_MINOR  ,
VW_VERSION_PATCH   
)

◆ wrap_text()

std::string VW::wrap_text ( VW::string_view  text,
size_t  width,
bool  wrap_after = true 
)

Wrap text by whole words with the given column width.

Parameters
texttext to wrap
widthcolumn width to wrap to
wrap_afterif word causes line to exceed width include word on same line. If false, this word would be wrapped to the next line.
Returns
std::string copy of string with required newlines

◆ write_example_to_cache()

void VW::write_example_to_cache ( io_buf output,
VW::example ae,
VW::label_parser lbl_parser,
uint64_t  parse_mask,
VW::details::cache_temp_buffer temp_buffer 
)

Variable Documentation

◆ DEFAULT_FLOAT_FORMATTING_DECIMAL_PRECISION

constexpr const int VW::DEFAULT_FLOAT_FORMATTING_DECIMAL_PRECISION = 2
static

◆ DEFAULT_FLOAT_PRECISION

constexpr const int VW::DEFAULT_FLOAT_PRECISION = 6
static

◆ git_commit

const std::string VW::git_commit