|
ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
|
A confusion matrix comparing predicted vs actual group labels. More...
#include <ConfusionMatrix.hpp>
Public Member Functions | |
| ConfusionMatrix ()=default | |
| Default-construct an empty confusion matrix. | |
| ConfusionMatrix (types::ResponseVector const &predictions, types::ResponseVector const &actual) | |
| Construct a confusion matrix from predictions and actual labels. | |
| float | error () const |
| Compute the overall error rate (1 - accuracy). | |
| types::Vector< float > | group_errors () const |
| Compute per-group error rates. | |
Public Attributes | |
| std::map< int, int > | label_index |
| Map from group label to matrix row/column index. | |
| types::Matrix< int > | values |
| The NxN confusion matrix (actual x predicted). | |
A confusion matrix comparing predicted vs actual group labels.
Rows correspond to actual groups and columns to predicted groups. Provides overall error rate, per-group error rates, JSON serialization, and formatted terminal printing with diagonal highlighting and marginal errors.
|
default |
Default-construct an empty confusion matrix.
| ppforest2::stats::ConfusionMatrix::ConfusionMatrix | ( | types::ResponseVector const & | predictions, |
| types::ResponseVector const & | actual ) |
Construct a confusion matrix from predictions and actual labels.
| predictions | The predicted group labels. |
| actual | The true group labels (must have the same size). |
| std::invalid_argument | If predictions and actual have different sizes. |
| float ppforest2::stats::ConfusionMatrix::error | ( | ) | const |
Compute the overall error rate (1 - accuracy).
| types::Vector< float > ppforest2::stats::ConfusionMatrix::group_errors | ( | ) | const |
Compute per-group error rates.
| std::map<int, int> ppforest2::stats::ConfusionMatrix::label_index |
Map from group label to matrix row/column index.
| types::Matrix<int> ppforest2::stats::ConfusionMatrix::values |
The NxN confusion matrix (actual x predicted).