22 #include "../common/exception.hpp"
29 namespace classifier {
48 const string& label) {
51 string incorrect_label;
52 float margin =
calc_margin(sfv, label, incorrect_label);
53 float loss = 1.f + margin;
59 if (sfv_norm == 0.f) {
73 return string(
"passive_aggressive_1");
jubatus::util::lang::shared_ptr< jubatus::core::storage::storage_base > storage_ptr
classifier_config config_
static float squared_norm(const common::sfv_t &sfv)
#define JUBATUS_EXCEPTION(e)
void check_touchable(const std::string &label)
passive_aggressive_1(storage_ptr storage)
std::vector< std::pair< std::string, float > > sfv_t
void touch(const std::string &label)
void train(const common::sfv_t &fv, const std::string &label)
float regularization_weight
float calc_margin(const common::sfv_t &sfv, const std::string &label, std::string &incorrect_label) const
void update_weight(const common::sfv_t &sfv, float step_weigth, const std::string &pos_label, const std::string &neg_class)