MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / BinaryErrorMetric

Class BinaryErrorMetric

src/metric/binary_metric.hpp:139–154  ·  view source on GitHub ↗

! * \brief Error rate metric for binary classification task. */

Source from the content-addressed store, hash-verified

137* \brief Error rate metric for binary classification task.
138*/
139class BinaryErrorMetric: public BinaryMetric<BinaryErrorMetric> {
140 public:
141 explicit BinaryErrorMetric(const Config& config) :BinaryMetric<BinaryErrorMetric>(config) {}
142
143 inline static double LossOnPoint(label_t label, double prob) {
144 if (prob <= 0.5f) {
145 return label > 0;
146 } else {
147 return label <= 0;
148 }
149 }
150
151 inline static const char* Name() {
152 return "binary_error";
153 }
154};
155
156/*!
157* \brief Auc Metric for binary classification task.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected