ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
Stats.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "utils/Types.hpp"
4#include "utils/Invariant.hpp"
5
6#include <set>
7#include <stdexcept>
8#include <pcg_random.hpp>
9
18namespace ppforest2::stats {
19 using RNG = pcg32;
20
21
29
36 std::set<types::Response> unique(types::ResponseVector const& column);
37
45 float accuracy(types::ResponseVector const& predictions, types::ResponseVector const& actual);
46
54 double error_rate(types::ResponseVector const& predictions, types::ResponseVector const& actual);
55
62 double sd(types::FeatureVector const& data);
63
71}
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
double sd(types::FeatureVector const &data)
Sample standard deviation of a vector.
double error_rate(types::ResponseVector const &predictions, types::ResponseVector const &actual)
Error rate of a prediction.
float accuracy(types::ResponseVector const &predictions, types::ResponseVector const &actual)
Accuracy of a prediction.
pcg32 RNG
Definition Stats.hpp:19
void sort(types::FeatureMatrix &x, types::ResponseVector &y)
Sort a feature matrix and a response vector by the response values.
std::set< types::Response > unique(types::ResponseVector const &column)
Unique values of a response vector.
Eigen::Matrix< Feature, Eigen::Dynamic, Eigen::Dynamic > FeatureMatrix
Dynamic-size matrix of feature values.
Definition Types.hpp:24
Eigen::Matrix< Feature, Eigen::Dynamic, 1 > FeatureVector
Dynamic-size column vector of feature values.
Definition Types.hpp:26
Eigen::Matrix< Response, Eigen::Dynamic, 1 > ResponseVector
Dynamic-size column vector of group labels.
Definition Types.hpp:29