Vowpal Wabbit
|
Classes | |
struct | conditional_contextual_bandit_outcome |
struct | label |
Typedefs | |
typedef v_array< ACTION_SCORE::action_scores > | decision_scores_t |
Enumerations | |
enum | example_type : uint8_t { unset = 0, shared = 1, action = 2, slot = 3 } |
Variables | |
label_parser | ccb_label_parser |
static constexpr uint32_t | SHARED_EX_INDEX = 0 |
static constexpr uint32_t | TOP_ACTION_INDEX = 0 |
Definition at line 28 of file conditional_contextual_bandit.h.
enum CCB::example_type : uint8_t |
Enumerator | |
---|---|
unset | |
shared | |
action | |
slot |
Definition at line 22 of file ccb_label.h.
void CCB::attach_label_to_example | ( | uint32_t | action_index_one_based, |
example * | example, | ||
conditional_contextual_bandit_outcome * | outcome, | ||
ccb & | data | ||
) |
Definition at line 147 of file conditional_contextual_bandit.cc.
References CB::cb_class::action, polylabel::cb, ccb::cb_label, CCB::conditional_contextual_bandit_outcome::cost, CB::cb_class::cost, CB::label::costs, example::l, CCB::conditional_contextual_bandit_outcome::probabilities, and CB::cb_class::probability.
Referenced by build_cb_example().
Definition at line 320 of file conditional_contextual_bandit.cc.
References polyprediction::a_s, ccb::action_score_pool, ccb::action_with_label, ccb::actions, attach_label_to_example(), polylabel::conditional_contextual_bandit, ccb::exclude_list, CCB::label::explicit_included_actions, ccb::include_list, inject_slot_features(), example::l, ccb::origin_index, CCB::label::outcome, example::pred, CCB::conditional_contextual_bandit_outcome::probabilities, ccb::shared, and example::tag.
void CCB::cache_label | ( | void * | v, |
io_buf & | cache | ||
) |
Definition at line 116 of file ccb_label.cc.
References io_buf::buf_write(), c, VW::convert(), CCB::conditional_contextual_bandit_outcome::cost, CCB::label::explicit_included_actions, CCB::label::outcome, CCB::conditional_contextual_bandit_outcome::probabilities, v_array< T >::size(), CCB::label::type, and CCB::label::weight.
void CCB::calculate_and_insert_interactions | ( | example * | shared, |
std::vector< example *> | actions, | ||
std::vector< std::string > & | generated_interactions | ||
) |
Definition at line 281 of file conditional_contextual_bandit.cc.
References ccb_id_namespace, example_predict::indices, INTERACTIONS::is_printable_namespace(), and INTERACTIONS::printable_start.
Referenced by learn_or_predict().
LEARNER::base_learner * CCB::ccb_explore_adf_setup | ( | options_i & | options, |
vw & | all | ||
) |
Definition at line 626 of file conditional_contextual_bandit.cc.
References VW::config::option_group_definition::add(), VW::config::options_i::add_and_parse(), LEARNER::as_multiline(), label_type::ccb, ccb_id_namespace, ccb_label_parser, prediction_type::decision_probs, ACTION_SCORE::delete_action_scores(), vw::delete_prediction, finish_multiline_example(), VW::hash_space(), LEARNER::init_learner(), VW::config::options_i::insert(), vw::interactions, vw::label_type, parser::lp, LEARNER::make_base(), VW::config::make_option(), vw::p, LEARNER::learner< T, E >::set_finish_example(), setup_base(), parameters::stride_shift(), THROW, VW::config::options_i::was_supplied(), and vw::weights.
Referenced by parse_reductions().
float CCB::ccb_weight | ( | void * | v | ) |
Definition at line 110 of file ccb_label.cc.
References CCB::label::weight.
void CCB::clear_all | ( | ccb & | data | ) |
Definition at line 60 of file conditional_contextual_bandit.cc.
References ccb::action_with_label, ccb::actions, ccb::shared, ccb::slots, and ccb::stored_labels.
Referenced by learn_or_predict().
void CCB::clear_pred_and_label | ( | ccb & | data | ) |
Definition at line 175 of file conditional_contextual_bandit.cc.
References ccb::action_with_label, and ccb::actions.
Referenced by learn_or_predict().
ACTION_SCORE::action_score CCB::convert_to_score | ( | const substring & | action_id_str, |
const substring & | probability_str | ||
) |
Definition at line 219 of file ccb_label.cc.
References float_of_substring(), int_of_substring(), and THROW.
Referenced by parse_outcome().
void CCB::copy_label | ( | void * | dst, |
void * | src | ||
) |
Definition at line 200 of file ccb_label.cc.
References copy_array(), CCB::conditional_contextual_bandit_outcome::cost, CCB::label::explicit_included_actions, CCB::label::outcome, CCB::conditional_contextual_bandit_outcome::probabilities, CCB::label::type, and CCB::label::weight.
void CCB::create_cb_labels | ( | ccb & | data | ) |
Definition at line 125 of file conditional_contextual_bandit.cc.
References ccb::actions, polylabel::cb, ccb::cb_label_pool, CB::label::costs, ccb::default_cb_label, example::l, ccb::shared, and CB::label::weight.
Referenced by learn_or_predict().
void CCB::default_label | ( | void * | v | ) |
Definition at line 165 of file ccb_label.cc.
References v_array< T >::clear(), v_array< T >::delete_v(), CCB::label::explicit_included_actions, CCB::label::outcome, CCB::conditional_contextual_bandit_outcome::probabilities, CCB::label::type, unset, and CCB::label::weight.
Referenced by read_cached_label().
void CCB::delete_cb_labels | ( | ccb & | data | ) |
Definition at line 137 of file conditional_contextual_bandit.cc.
References ccb::actions, polylabel::cb, ccb::cb_label_pool, CB::label::costs, example::l, return_v_array(), and ccb::shared.
Referenced by learn_or_predict().
void CCB::delete_label | ( | void * | v | ) |
Definition at line 188 of file ccb_label.cc.
References v_array< T >::delete_v(), CCB::label::explicit_included_actions, CCB::label::outcome, and CCB::conditional_contextual_bandit_outcome::probabilities.
bool CCB::ec_is_example_header | ( | example const & | ec | ) |
Definition at line 686 of file conditional_contextual_bandit.cc.
References polylabel::conditional_contextual_bandit, example::l, shared, and CCB::label::type.
Referenced by LEARNER::example_is_newline_not_header().
Definition at line 609 of file conditional_contextual_bandit.cc.
References ccb::action_score_pool, vw::final_prediction_sink, VW::finish_example(), CB_ADF::global_print_newline(), output_example(), and return_v_array().
bool CCB::has_action | ( | multi_ex & | cb_ex | ) |
Definition at line 184 of file conditional_contextual_bandit.cc.
Referenced by learn_or_predict().
Definition at line 190 of file conditional_contextual_bandit.cc.
References LabelDict::add_example_namespace(), ccb_slot_namespace, constant_namespace, default_namespace, example_predict::feature_space, and example_predict::indices.
Referenced by build_cb_example().
Definition at line 211 of file conditional_contextual_bandit.cc.
References ccb::all, ccb::base_learner_stride_shift, ccb_id_namespace, example_predict::feature_space, VW::hash_feature(), id(), ccb::id_namespace_hash, ccb::id_namespace_str, example_predict::indices, v_array< T >::push_back(), ccb::slot_id_hashes, prediction_type::to_string(), and vw::wpp.
void CCB::learn_or_predict | ( | ccb & | data, |
multi_learner & | base, | ||
multi_ex & | examples | ||
) |
Definition at line 385 of file conditional_contextual_bandit.cc.
References ccb::actions, ccb::all, vw::audit, calculate_and_insert_interactions(), ccb::cb_ex, clear_all(), clear_pred_and_label(), create_cb_labels(), delete_cb_labels(), ccb::exclude_list, ccb::generated_interactions, has_action(), ccb::include_list, example_predict::interactions, ccb::original_interactions, remove_slot_features(), save_action_scores(), ccb::shared, slot, ccb::slots, split_multi_example_and_stash_labels(), ccb::stored_labels, and example::tag.
Definition at line 557 of file conditional_contextual_bandit.cc.
References vw::final_prediction_sink, CB_ALGS::get_cost_estimate(), loss(), print_decision_scores(), print_update(), vw::sd, slot, TOP_ACTION_INDEX, and shared_data::update().
Referenced by finish_multiline_example().
void CCB::parse_explicit_inclusions | ( | CCB::label * | ld, |
v_array< substring > & | split_inclusions | ||
) |
Definition at line 277 of file ccb_label.cc.
References CCB::label::explicit_included_actions, int_of_substring(), and v_array< T >::push_back().
Referenced by parse_label().
void CCB::parse_label | ( | parser * | p, |
shared_data * | , | ||
void * | v, | ||
v_array< substring > & | words | ||
) |
Definition at line 285 of file ccb_label.cc.
References accumulate(), v_array< T >::begin(), v_array< T >::end(), f, recall_tree_ns::find(), CCB::label::outcome, parse_explicit_inclusions(), parser::parse_name, parse_outcome(), CCB::conditional_contextual_bandit_outcome::probabilities, shared, v_array< T >::size(), slot, substring_equal(), THROW, tokenize(), CCB::label::type, and CCB::label::weight.
CCB::conditional_contextual_bandit_outcome* CCB::parse_outcome | ( | substring & | outcome | ) |
Definition at line 241 of file ccb_label.cc.
References convert_to_score(), float_of_substring(), THROW, and tokenize().
Referenced by parse_label().
void CCB::print_decision_scores | ( | int | f, |
decision_scores_t & | decision_scores | ||
) |
Definition at line 471 of file conditional_contextual_bandit.cc.
References slot, and io_buf::write_file_or_socket().
Referenced by output_example().
void CCB::print_update | ( | vw & | all, |
std::vector< example *> & | slots, | ||
decision_scores_t & | decision_scores, | ||
size_t | num_features | ||
) |
Definition at line 493 of file conditional_contextual_bandit.cc.
References vw::bfgs, shared_data::col_current_label, shared_data::col_current_predict, vw::current_pass, shared_data::dump_interval, vw::holdout_set_off, shared_data::print_update(), vw::progress_add, vw::progress_arg, vw::quiet, vw::sd, slot, prediction_type::to_string(), and shared_data::weighted_examples().
Referenced by output_example().
size_t CCB::read_cached_label | ( | shared_data * | , |
void * | v, | ||
io_buf & | cache | ||
) |
Definition at line 26 of file ccb_label.cc.
References io_buf::buf_read(), v_array< T >::clear(), CCB::conditional_contextual_bandit_outcome::cost, default_label(), CCB::label::explicit_included_actions, CCB::label::outcome, CCB::conditional_contextual_bandit_outcome::probabilities, v_array< T >::push_back(), CCB::label::type, and CCB::label::weight.
Definition at line 259 of file conditional_contextual_bandit.cc.
References ccb_slot_namespace, constant_namespace, default_namespace, LabelDict::del_example_namespace(), example_predict::feature_space, and example_predict::indices.
Referenced by learn_or_predict().
void CCB::remove_slot_id | ( | example * | shared | ) |
Definition at line 247 of file conditional_contextual_bandit.cc.
References ccb_id_namespace, example_predict::feature_space, example_predict::indices, and v_array< T >::pop().
bool CCB::sanity_checks | ( | ccb & | data | ) |
Definition at line 100 of file conditional_contextual_bandit.cc.
References ccb::actions, slot, and ccb::slots.
void CCB::save_action_scores | ( | ccb & | data, |
decision_scores_t & | decision_scores | ||
) |
Definition at line 159 of file conditional_contextual_bandit.cc.
References polyprediction::a_s, ccb::exclude_list, ccb::origin_index, example::pred, v_array< T >::push_back(), and ccb::shared.
Referenced by learn_or_predict().
Definition at line 71 of file conditional_contextual_bandit.cc.
References ccb::actions, shared, ccb::shared, slot, ccb::slots, and ccb::stored_labels.
Referenced by learn_or_predict().
bool CCB::test_label | ( | void * | v | ) |
Definition at line 182 of file ccb_label.cc.
References CCB::label::outcome.
label_parser CCB::ccb_label_parser |
Definition at line 358 of file ccb_label.cc.
Referenced by ccb_explore_adf_setup().
|
static |
Definition at line 57 of file conditional_contextual_bandit.cc.
|
static |
Definition at line 58 of file conditional_contextual_bandit.cc.
Referenced by output_example().