4#include "../Utilities/clue.hpp"
24 const Eigen::MatrixXd &labels)
26 Eigen::VectorXi absolute_predictions;
29 Eigen::VectorXi class_labels;
32 accuracy = (absolute_predictions.array() == class_labels.array()).cast<double>().mean();
41 static void onehotdecode(Eigen::VectorXi &decoded,
const Eigen::MatrixXd &onehot)
43 decoded.resize(onehot.rows());
44 for (
int i = 0; i < onehot.rows(); ++i)
46 onehot.row(i).maxCoeff(&decoded[i]);
Metrics class.
Definition Metrics.hpp:14
static void accuracy(double &accuracy, const Eigen::MatrixXd &predicted, const Eigen::MatrixXd &labels)
Calculates the accuracy of the model.
Definition Metrics.hpp:23
static void onehotdecode(Eigen::VectorXi &decoded, const Eigen::MatrixXd &onehot)
Decodes one-hot encoded data.
Definition Metrics.hpp:41
Definition Activation.hpp:6