diff options
Diffstat (limited to 'vowpalwabbit/binary.cc')
-rw-r--r-- | vowpalwabbit/binary.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/vowpalwabbit/binary.cc b/vowpalwabbit/binary.cc index f7f0e8b4..46694b26 100644 --- a/vowpalwabbit/binary.cc +++ b/vowpalwabbit/binary.cc @@ -6,22 +6,22 @@ using namespace LEARNER; namespace BINARY { template <bool is_learn> - void predict_or_learn(void* d, learner& base, example* ec) { + void predict_or_learn(float&, learner& base, example& ec) { if (is_learn) base.learn(ec); else base.predict(ec); - if ( ec->final_prediction > 0) - ec->final_prediction = 1; + if ( ec.final_prediction > 0) + ec.final_prediction = 1; else - ec->final_prediction = -1; + ec.final_prediction = -1; - label_data* ld = (label_data*)ec->ld;//New loss - if (ld->label == ec->final_prediction) - ec->loss = 0.; + label_data* ld = (label_data*)ec.ld;//New loss + if (ld->label == ec.final_prediction) + ec.loss = 0.; else - ec->loss = 1.; + ec.loss = 1.; } learner* setup(vw& all, std::vector<std::string>&opts, po::variables_map& vm, po::variables_map& vm_file) @@ -36,8 +36,8 @@ namespace BINARY { all.sd->binary_label = true; //Create new learner learner* ret = new learner(NULL, all.l); - ret->set_learn<void, predict_or_learn<true> >(); - ret->set_predict<void, predict_or_learn<false> >(); + ret->set_learn<float, predict_or_learn<true> >(); + ret->set_predict<float, predict_or_learn<false> >(); return ret; } } |