Vowpal Wabbit
|
Classes | |
struct | csoaa |
struct | ldf |
Functions | |
template<bool is_learn> | |
void | inner_loop (single_learner &base, example &ec, uint32_t i, float cost, uint32_t &prediction, float &score, float &partial_prediction) |
template<bool is_learn> | |
void | predict_or_learn (csoaa &c, single_learner &base, example &ec) |
void | finish_example (vw &all, csoaa &, example &ec) |
base_learner * | csoaa_setup (options_i &options, vw &all) |
bool | ec_is_label_definition (example &ec) |
bool | ec_seq_is_label_definition (multi_ex &ec_seq) |
bool | ec_seq_has_label_definition (multi_ex &ec_seq) |
bool | cmp_wclass_ptr (const COST_SENSITIVE::wclass *a, const COST_SENSITIVE::wclass *b) |
void | compute_wap_values (std::vector< COST_SENSITIVE::wclass *> costs) |
void | subtract_feature (example &ec, float feature_value_x, uint64_t weight_index) |
void | subtract_example (vw &all, example *ec, example *ecsub) |
void | unsubtract_example (example *ec) |
void | make_single_prediction (ldf &data, single_learner &base, example &ec) |
bool | test_ldf_sequence (ldf &data, multi_ex &ec_seq) |
void | do_actual_learning_wap (ldf &data, single_learner &base, multi_ex &ec_seq) |
void | do_actual_learning_oaa (ldf &data, single_learner &base, multi_ex &ec_seq) |
multi_ex | process_labels (ldf &data, const multi_ex &ec_seq_all) |
template<bool is_learn> | |
void | do_actual_learning (ldf &data, single_learner &base, multi_ex &ec_seq_all) |
void | global_print_newline (vw &all) |
void | output_example (vw &all, example &ec, bool &hit_loss, multi_ex *ec_seq, ldf &data) |
void | output_rank_example (vw &all, example &head_ec, bool &hit_loss, multi_ex *ec_seq) |
void | output_example_seq (vw &all, ldf &data, multi_ex &ec_seq) |
void | end_pass (ldf &data) |
void | finish_multiline_example (vw &all, ldf &data, multi_ex &ec_seq) |
void | process_label (ldf &data, example *ec) |
base_learner * | csldf_setup (options_i &options, vw &all) |
|
inline |
Definition at line 197 of file csoaa.cc.
References COST_SENSITIVE::wclass::x.
Referenced by compute_wap_values().
void CSOAA::compute_wap_values | ( | std::vector< COST_SENSITIVE::wclass *> | costs | ) |
Definition at line 199 of file csoaa.cc.
References cmp_wclass_ptr().
Referenced by do_actual_learning_wap().
LEARNER::base_learner * CSOAA::csldf_setup | ( | options_i & | options, |
vw & | all | ||
) |
Definition at line 787 of file csoaa.cc.
References prediction_type::action_scores, VW::config::option_group_definition::add(), VW::config::options_i::add_and_parse(), LEARNER::as_singleline(), vw::cost_sensitive, label_type::cs, COST_SENSITIVE::cs_label, ACTION_SCORE::delete_action_scores(), vw::delete_prediction, parser::emptylines_separate_examples, LEARNER::end_pass(), finish_multiline_example(), loss_function::getType(), LEARNER::init_learner(), vw::label_type, vw::loss, parser::lp, LEARNER::make_base(), VW::config::make_option(), prediction_type::multiclass, vw::options, vw::p, prediction_type::prob, shared_data::report_multiclass_log_loss, vw::sd, LEARNER::learner< T, E >::set_end_pass(), LEARNER::learner< T, E >::set_finish_example(), setup_base(), LabelDict::size_t_eq(), THROW, vw::trace_message, vw::training, and VW::config::options_i::was_supplied().
Referenced by parse_reductions().
LEARNER::base_learner * CSOAA::csoaa_setup | ( | options_i & | options, |
vw & | all | ||
) |
Definition at line 117 of file csoaa.cc.
References VW::config::options_i::add_and_parse(), LEARNER::as_singleline(), c, vw::cost_sensitive, label_type::cs, COST_SENSITIVE::cs_label, finish_example(), LEARNER::init_learner(), vw::label_type, parser::lp, LEARNER::make_base(), VW::config::make_option(), prediction_type::multiclass, vw::options, vw::p, setup_base(), and VW::config::options_i::was_supplied().
Referenced by parse_reductions().
void CSOAA::do_actual_learning | ( | ldf & | data, |
single_learner & | base, | ||
multi_ex & | ec_seq_all | ||
) |
Definition at line 420 of file csoaa.cc.
References polyprediction::a_s, CSOAA::ldf::a_s, ACTION_SCORE::action_score::action, v_array< T >::begin(), v_array< T >::clear(), correctedExp, do_actual_learning_oaa(), do_actual_learning_wap(), ec_seq_has_label_definition(), CSOAA::ldf::ft_offset, CSOAA::ldf::is_probabilities, CSOAA::ldf::is_wap, make_single_prediction(), example::partial_prediction, example::pred, prediction_type::prob, polyprediction::prob, process_labels(), v_array< T >::push_back(), CSOAA::ldf::rank, ACTION_SCORE::action_score::score, ACTION_SCORE::score_comp(), v_array< T >::size(), CSOAA::ldf::stored_preds, test_ldf_sequence(), and THROW.
void CSOAA::do_actual_learning_oaa | ( | ldf & | data, |
single_learner & | base, | ||
multi_ex & | ec_seq | ||
) |
Definition at line 351 of file csoaa.cc.
References LabelDict::add_example_namespace_from_memory(), COST_SENSITIVE::label::costs, polylabel::cs, LabelDict::del_example_namespace_from_memory(), CSOAA::ldf::ft_offset, label_data::initial, example::l, label_data::label, CSOAA::ldf::label_features, LEARNER::learner< T, E >::learn(), process_labels(), simple_label, and CSOAA::ldf::treat_as_classifier.
Referenced by do_actual_learning().
void CSOAA::do_actual_learning_wap | ( | ldf & | data, |
single_learner & | base, | ||
multi_ex & | ec_seq | ||
) |
Definition at line 292 of file csoaa.cc.
References LabelDict::add_example_namespace_from_memory(), CSOAA::ldf::all, compute_wap_values(), COST_SENSITIVE::label::costs, polylabel::cs, LabelDict::del_example_namespace_from_memory(), f, example_predict::ft_offset, CSOAA::ldf::ft_offset, label_data::initial, example::l, label_data::label, CSOAA::ldf::label_features, LEARNER::learner< T, E >::learn(), example::partial_prediction, polylabel::simple, simple_label, subtract_example(), unsubtract_example(), and example::weight.
Referenced by do_actual_learning().
bool CSOAA::ec_is_label_definition | ( | example & | ec | ) |
Definition at line 168 of file csoaa.cc.
References COST_SENSITIVE::label::costs, polylabel::cs, v_array< T >::empty(), example_predict::indices, and example::l.
Referenced by ec_seq_has_label_definition(), ec_seq_is_label_definition(), output_example(), output_rank_example(), and process_labels().
bool CSOAA::ec_seq_has_label_definition | ( | multi_ex & | ec_seq | ) |
Definition at line 192 of file csoaa.cc.
References ec_is_label_definition().
Referenced by do_actual_learning().
bool CSOAA::ec_seq_is_label_definition | ( | multi_ex & | ec_seq | ) |
Definition at line 181 of file csoaa.cc.
References ec_is_label_definition(), and THROW.
Referenced by output_example_seq().
void CSOAA::end_pass | ( | ldf & | data | ) |
Definition at line 725 of file csoaa.cc.
References CSOAA::ldf::first_pass.
Definition at line 115 of file csoaa.cc.
References COST_SENSITIVE::finish_example().
Referenced by csoaa_setup(), and finish_example().
Definition at line 727 of file csoaa.cc.
References VW::finish_example(), global_print_newline(), and output_example_seq().
void CSOAA::global_print_newline | ( | vw & | all | ) |
Definition at line 530 of file csoaa.cc.
References f, vw::final_prediction_sink, and io_buf::write_file_or_socket().
Referenced by finish_multiline_example().
|
inline |
Definition at line 33 of file csoaa.cc.
References add_passthrough_feature, f, example::l, label_data::label, LEARNER::learner< T, E >::learn(), example::partial_prediction, LEARNER::learner< T, E >::predict(), polylabel::simple, and example::weight.
void CSOAA::make_single_prediction | ( | ldf & | data, |
single_learner & | base, | ||
example & | ec | ||
) |
Definition at line 251 of file csoaa.cc.
References LabelDict::add_example_namespace_from_memory(), COST_SENSITIVE::label::costs, polylabel::cs, LabelDict::del_example_namespace_from_memory(), example_predict::ft_offset, CSOAA::ldf::ft_offset, label_data::initial, example::l, label_data::label, CSOAA::ldf::label_features, example::partial_prediction, LEARNER::learner< T, E >::predict(), polylabel::simple, and simple_label.
Referenced by do_actual_learning().
void CSOAA::output_example | ( | vw & | all, |
example & | ec, | ||
bool & | hit_loss, | ||
multi_ex * | ec_seq, | ||
ldf & | data | ||
) |
Definition at line 543 of file csoaa.cc.
References COST_SENSITIVE::label::costs, polylabel::cs, COST_SENSITIVE::cs_label, ec_is_label_definition(), example_is_newline(), vw::final_prediction_sink, CSOAA::ldf::is_probabilities, example::l, loss(), polyprediction::multiclass, example::num_features, example::partial_prediction, example::pred, vw::print, vw::print_text, COST_SENSITIVE::print_update(), polyprediction::prob, vw::raw_prediction, vw::sd, v_array< T >::size(), shared_data::sum_loss, shared_data::sum_loss_since_last_dump, example::tag, test_label(), and shared_data::total_features.
Referenced by output_example_seq().
Definition at line 669 of file csoaa.cc.
References ec_seq_is_label_definition(), shared_data::example_number, shared_data::holdout_multiclass_log_loss, vw::holdout_set_off, CSOAA::ldf::is_probabilities, shared_data::multiclass_log_loss, output_example(), output_rank_example(), vw::print_text, CSOAA::ldf::rank, vw::raw_prediction, vw::sd, test_ldf_sequence(), shared_data::weighted_labeled_examples, and shared_data::weighted_unlabeled_examples.
Definition at line 616 of file csoaa.cc.
References polyprediction::a_s, COST_SENSITIVE::label::costs, polylabel::cs, COST_SENSITIVE::cs_label, ec_is_label_definition(), example_is_newline(), vw::final_prediction_sink, example::l, loss(), example::num_features, example::pred, ACTION_SCORE::print_action_score(), vw::print_text, COST_SENSITIVE::print_update(), vw::raw_prediction, vw::sd, v_array< T >::size(), shared_data::sum_loss, shared_data::sum_loss_since_last_dump, example::tag, test_label(), and shared_data::total_features.
Referenced by output_example_seq().
void CSOAA::predict_or_learn | ( | csoaa & | c, |
single_learner & | base, | ||
example & | ec | ||
) |
Definition at line 57 of file csoaa.cc.
References add_passthrough_feature, constant, COST_SENSITIVE::label::costs, polylabel::cs, DO_MULTIPREDICT, features::indicies, example::l, polyprediction::multiclass, LEARNER::learner< T, E >::multipredict(), CSOAA::csoaa::num_classes, example::partial_prediction, example::passthrough, CSOAA::csoaa::pred, example::pred, polyprediction::scalar, polylabel::simple, features::size(), and features::values.
Definition at line 741 of file csoaa.cc.
References COST_SENSITIVE::label::costs, polylabel::cs, example_predict::feature_space, example_predict::indices, example::l, CSOAA::ldf::label_features, and LabelDict::set_label_features().
Referenced by process_labels().
Definition at line 756 of file csoaa.cc.
References ec_is_label_definition(), and process_label().
Referenced by do_actual_learning(), and do_actual_learning_oaa().
Definition at line 217 of file csoaa.cc.
References example_predict::feature_space, example_predict::indices, example::num_features, v_array< T >::push_back(), features::size(), features::sum_feat_sq, example::total_sum_feat_sq, and wap_ldf_namespace.
Referenced by do_actual_learning_wap().
void CSOAA::subtract_feature | ( | example & | ec, |
float | feature_value_x, | ||
uint64_t | weight_index | ||
) |
Definition at line 211 of file csoaa.cc.
References example_predict::feature_space, and wap_ldf_namespace.
Definition at line 271 of file csoaa.cc.
References CSOAA::ldf::all, COST_SENSITIVE::cs_label, label_parser::test_label, test_label(), and vw::trace_message.
Referenced by do_actual_learning(), and output_example_seq().
void CSOAA::unsubtract_example | ( | example * | ec | ) |
Definition at line 227 of file csoaa.cc.
References features::clear(), v_array< T >::decr(), v_array< T >::empty(), example_predict::feature_space, example_predict::indices, v_array< T >::last(), example::num_features, features::size(), features::sum_feat_sq, example::total_sum_feat_sq, and wap_ldf_namespace.
Referenced by do_actual_learning_wap().