slope 6.6.0
Loading...
Searching...
No Matches
slope::MisClass Class Reference

Misclassification Rate scoring metric. More...

#include <score.h>

Inheritance diagram for slope::MisClass:
Collaboration diagram for slope::MisClass:

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)

Detailed Description

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.

Definition at line 285 of file score.h.

Member Function Documentation

◆ eval() [1/2]

double slope::MisClass::eval ( const Eigen::MatrixXd & eta,
const Eigen::MatrixXd & y,
const std::unique_ptr< Loss > & loss ) const
overridevirtual

Evaluates the misclassification rate between predictions and true labels.

Parameters
etaMatrix of model predictions/probabilities
yMatrix of true labels (one-hot encoded)
lossLoss function used to transform predictions if needed
Returns
Proportion of incorrect predictions (between 0 and 1)

Implements slope::Score.

◆ eval() [2/2]

double slope::MisClass::eval ( const Eigen::MatrixXd & eta,
const Eigen::MatrixXd & y,
const std::unique_ptr< Loss > & loss,
const Eigen::VectorXd & observation_weights ) const
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.


The documentation for this class was generated from the following file: