25 Scorer::Scorer(
string scorer)
34 this->set_scorer(scorer);
36 void Scorer::set_scorer(
string scorer)
38 this->scorer = scorer;
41 float Scorer::score(
const VectorXf& y_true,
42 const shared_ptr<CLabels>& yhat,
44 const vector<float>& w)
46 if ( score_hash.find(this->scorer) == score_hash.end() )
56 return score_hash.at(this->scorer)(y_true, yhat, loss, w);
60 float Scorer::score(
const VectorXf& y_true,
61 const shared_ptr<CLabels>& yhat,
65 return this->score(y_true, yhat, dummy, w);
#define THROW_INVALID_ARGUMENT(err)
float bal_zero_one_loss_label(const VectorXf &y, const shared_ptr< CLabels > &labels, VectorXf &loss, const vector< float > &class_weights)
float zero_one_loss_label(const VectorXf &y, const shared_ptr< CLabels > &labels, VectorXf &loss, const vector< float > &class_weights)
1 - accuracy
float mse_label(const VectorXf &y, const shared_ptr< CLabels > &labels, VectorXf &loss, const vector< float > &weights)
float multi_log_loss_label(const VectorXf &y, const shared_ptr< CLabels > &labels, VectorXf &loss, const vector< float > &class_weights)
multinomial log loss
float false_positive_loss_label(const VectorXf &y, const shared_ptr< CLabels > &labels, VectorXf &loss, const vector< float > &class_weights)
false positive rate
float log_loss_label(const VectorXf &y, const shared_ptr< CLabels > &labels, VectorXf &loss, const vector< float > &class_weights)
log loss