|
CMP++: Uncertainty Quantification & Bayesian Calibration
|
Baseline classifier predicting class labels based on training frequency distributions. More...
#include <classifier.h>


Public Member Functions | |
| void | condition (const Eigen::Ref< const Eigen::MatrixXd > &xObs, const Eigen::Ref< const Eigen::VectorXs > &labels) |
| Computes the class frequencies from training labels. | |
| size_t | predict (const Eigen::Ref< const Eigen::VectorXd > &x) const override |
| Predicts the class label with the highest prior frequency. | |
| std::vector< double > | predictProbabilities (const Eigen::Ref< const Eigen::VectorXd > &x) const override |
| Estimates the class prior probabilities based on training frequencies. | |
Public Member Functions inherited from cmp::classifier::Classifier | |
| virtual | ~Classifier ()=default |
Private Attributes | |
| size_t | nClasses_ {1} |
| Total number of class labels. | |
Baseline classifier predicting class labels based on training frequency distributions.
Mathematical Formulation The predicted probability for class \(c\) at any input point \(\mathbf{x}\) is equal to the class prior:
\[ P(y=c \mid \mathbf{x}) = \frac{N_c}{N} \]
where \(N_c\) is the number of occurrences of class \(c\) in the training set and \(N\) is the total number of training observations.
Implementation Algorithm
condition() computes class counts \(N_c\) from the labels training vector.predictProbabilities() returns a vector of class proportions. | void cmp::classifier::Dummy::condition | ( | const Eigen::Ref< const Eigen::MatrixXd > & | xObs, |
| const Eigen::Ref< const Eigen::VectorXs > & | labels | ||
| ) |
Computes the class frequencies from training labels.
| xObs | A matrix of training observations (unused). |
| labels | A vector of training labels. |
|
overridevirtual |
Predicts the class label with the highest prior frequency.
| x | The query point (unused). |
Implements cmp::classifier::Classifier.
|
overridevirtual |
Estimates the class prior probabilities based on training frequencies.
| x | The query point (unused). |
Implements cmp::classifier::Classifier.
|
private |
Total number of class labels.