![]() |
slope 6.6.0
|
Base class for scoring metrics used in regularized generalized linear regression. More...
#include <score.h>

Public Member Functions | |
| virtual bool | isWorse (double other, double current) const =0 |
| virtual double | initValue () const =0 |
| std::function< bool(double, double)> | getComparator () const |
| virtual double | eval (const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y, const std::unique_ptr< Loss > &loss) const =0 |
| virtual double | eval (const Eigen::MatrixXd &eta, const Eigen::MatrixXd &y, const std::unique_ptr< Loss > &loss, const Eigen::VectorXd &observation_weights) const |
Static Public Member Functions | |
| static std::unique_ptr< Score > | create (const std::string &metric) |
Base class for scoring metrics used in regularized generalized linear regression.
This abstract class defines the interface for computing various performance metrics that evaluate model predictions against true responses. Derived classes implement specific metrics like MSE, MAE, AUC-ROC etc.
|
static |
|
pure virtual |
Evaluates the scoring metric given predictions and true responses.
| eta | Matrix of model predictions |
| y | Matrix of true responses |
| loss | Loss function used in the model |
Implemented in slope::Accuracy, slope::AUC, slope::Deviance, slope::MAE, slope::MisClass, and slope::MSE.
|
virtual |
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 in slope::Accuracy, slope::AUC, slope::Deviance, slope::MAE, slope::MisClass, and slope::MSE.
| std::function< bool(double, double)> slope::Score::getComparator | ( | ) | const |
Returns a comparator function for comparing score values.
|
pure virtual |
Returns the initial/default value for this scoring metric.
Implemented in slope::MaximizeScore, and slope::MinimizeScore.
|
pure virtual |
Determines if a score value indicates worse performance.
| other | The score to compare against |
| current | The current score |
Implemented in slope::MaximizeScore, and slope::MinimizeScore.