![]() |
slope 6.6.0
|
Misclassification Rate scoring metric. More...
#include <score.h>


Public Member Functions | |
| double | eval (const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y, const std::unique_ptr< Loss > &loss) const override |
| double | eval (const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y, const std::unique_ptr< Loss > &loss, const Eigen::VectorXd &observation_weights) const override |
| Public Member Functions inherited from slope::MinimizeScore | |
| bool | isWorse (double a, double b) const override |
| double | initValue () const override |
| Public Member Functions inherited from slope::Score | |
| std::function< bool(double, double)> | getComparator () const |
Additional Inherited Members | |
| Static Public Member Functions inherited from slope::Score | |
| static std::unique_ptr< Score > | create (const std::string &metric) |
Misclassification Rate scoring metric.
Computes the proportion of incorrect predictions in classification problems. Inherits from MinimizeScore since lower misclassification rates indicate better performance.
Misclassification Rate = 1 - Accuracy = (number of incorrect predictions) / (total number of predictions)
For binary classification, predictions are thresholded at 0.5. For multi-class problems, the class with highest probability is selected as the prediction for each sample.
|
overridevirtual |
Evaluates the misclassification rate between predictions and true labels.
| eta | Matrix of model predictions/probabilities |
| y | Matrix of true labels (one-hot encoded) |
| loss | Loss function used to transform predictions if needed |
Implements slope::Score.
|
overridevirtual |
Evaluates the metric with observation weights. Empty weights select the unweighted metric. Weights must be finite and nonnegative, and their sum must be positive. Multiplying every weight by a positive constant leaves the score unchanged. Custom metrics can override this overload; the default implementation accepts uniform weights only.
Reimplemented from slope::Score.