25 namespace regression {
56 for (
size_t i = 0; i < fv.size(); ++i) {
57 norm += fv[i].second * fv[i].second;
70 float error = value - predict;
71 float sign_error = error > 0.f ? 1.0f : -1.0f;
76 float coeff = sign_error * std::min(C, loss) /
squared_norm(fv);
77 if (!std::isinf(coeff)) {
jubatus::util::lang::shared_ptr< jubatus::core::storage::storage_base > storage_ptr
passive_aggressive(const config &config, storage_ptr storage)
float regularization_weight
static float squared_norm(const common::sfv_t &fv)
#define JUBATUS_EXCEPTION(e)
float estimate(const common::sfv_t &fv) const
void update(const common::sfv_t &fv, float coeff)
std::vector< std::pair< std::string, float > > sfv_t
void train(const common::sfv_t &fv, float value)