Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <shogun/classifier/vw/vw_example.h>
00016
00017 using namespace shogun;
00018
00019 VwExample::VwExample(): tag(), indices(), atomics(),
00020 num_features(0), pass(0),
00021 final_prediction(0.), loss(0),
00022 eta_round(0.), global_weight(0),
00023 example_t(0), total_sum_feat_sq(1), sorted(false)
00024 {
00025 ld = new VwLabel();
00026 }
00027
00028 VwExample::~VwExample()
00029 {
00030 if (ld)
00031 delete ld;
00032 }
00033
00034 void VwExample::reset_members()
00035 {
00036 num_features = 0;
00037 total_sum_feat_sq = 1;
00038 example_counter = 0;
00039 global_weight = 0;
00040 example_t = 0;
00041 eta_round = 0;
00042 final_prediction = 0;
00043 loss = 0;
00044
00045 for (vw_size_t* i = indices.begin; i != indices.end; i++)
00046 {
00047 atomics[*i].erase();
00048 sum_feat_sq[*i]=0;
00049 }
00050
00051 indices.erase();
00052 tag.erase();
00053 }