ppforest2 v0.1.0
Projection Pursuit Decision Trees and Random Forests
Loading...
Searching...
No Matches
DataPacket.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "stats/Stats.hpp"
4#include "utils/Types.hpp"
5
6#include <set>
7#include <string>
8#include <vector>
9
10namespace ppforest2::stats {
18 struct DataPacket {
24 std::set<types::Response> const groups;
32 std::vector<std::string> const group_names;
39 std::vector<std::string> const feature_names;
40
43 std::set<types::Response> const& groups,
44 std::vector<std::string> const& group_names = {},
45 std::vector<std::string> const& feature_names = {})
46 : x(x)
47 , y(y)
48 , groups(groups)
51
54 std::vector<std::string> const& group_names = {},
55 std::vector<std::string> const& feature_names = {})
56 : x(x)
57 , y(y)
58 , groups(unique(y))
61
63 : x(types::FeatureMatrix())
64 , y(types::Vector<types::Response>())
65 , groups(std::set<types::Response>()) {}
66 };
67}
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
std::set< types::Response > unique(types::ResponseVector const &column)
Unique values of a response vector.
Core numeric type aliases for the ppforest2 library.
Definition Types.hpp:12
Eigen::Matrix< Feature, Eigen::Dynamic, Eigen::Dynamic > FeatureMatrix
Dynamic-size matrix of feature values.
Definition Types.hpp:24
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
Generic dynamic-size column vector.
Definition Types.hpp:35
types::Vector< types::Response > const y
Response vector (n).
Definition DataPacket.hpp:22
DataPacket()
Definition DataPacket.hpp:62
std::vector< std::string > const feature_names
Original feature column names from the CSV header.
Definition DataPacket.hpp:39
std::vector< std::string > const group_names
Original group label names, indexed by integer code.
Definition DataPacket.hpp:32
std::set< types::Response > const groups
Set of distinct group labels.
Definition DataPacket.hpp:24
types::FeatureMatrix const x
Feature matrix (n × p).
Definition DataPacket.hpp:20
DataPacket(types::FeatureMatrix const &x, types::Vector< types::Response > const &y, std::set< types::Response > const &groups, std::vector< std::string > const &group_names={}, std::vector< std::string > const &feature_names={})
Definition DataPacket.hpp:41
DataPacket(types::FeatureMatrix const &x, types::Vector< types::Response > const &y, std::vector< std::string > const &group_names={}, std::vector< std::string > const &feature_names={})
Definition DataPacket.hpp:52