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 {
19 struct DataPacket {
25 std::set<types::GroupId> groups;
41
45 std::set<types::GroupId> const& groups,
46 types::Names const& group_names = {},
47 types::Names const& feature_names = {}
48 )
49 : x(x)
50 , y(y)
51 , groups(groups)
54
58 types::Names const& group_names = {},
59 types::Names const& feature_names = {}
60 )
61 : x(x)
62 , y(y)
63 , groups(unique(y.cast<types::GroupId>()))
66
67 DataPacket() = default;
68 };
69}
Statistical infrastructure for training and evaluation.
Definition ConfusionMatrix.hpp:11
std::set< types::GroupId > unique(types::GroupIdVector const &column)
Unique group labels in a response vector.
Core numeric type aliases for the ppforest2 library.
Definition Types.hpp:22
std::vector< std::string > Names
Vector of name strings — used uniformly for class labels (group_names[i] is the label for GroupId == ...
Definition Types.hpp:49
Eigen::Matrix< Feature, Eigen::Dynamic, Eigen::Dynamic > FeatureMatrix
Dynamic-size matrix of feature values.
Definition Types.hpp:33
Eigen::Matrix< Outcome, Eigen::Dynamic, 1 > OutcomeVector
Dynamic-size column vector of predictions.
Definition Types.hpp:42
types::FeatureMatrix x
Feature matrix (n × p).
Definition DataPacket.hpp:21
DataPacket(types::FeatureMatrix const &x, types::OutcomeVector const &y, std::set< types::GroupId > const &groups, types::Names const &group_names={}, types::Names const &feature_names={})
Definition DataPacket.hpp:42
types::Names feature_names
Original feature column names from the CSV header.
Definition DataPacket.hpp:40
types::Names group_names
Original group label names, indexed by integer code.
Definition DataPacket.hpp:33
std::set< types::GroupId > groups
Set of distinct group labels (classification only; empty for regression).
Definition DataPacket.hpp:25
DataPacket(types::FeatureMatrix const &x, types::OutcomeVector const &y, types::Names const &group_names={}, types::Names const &feature_names={})
Definition DataPacket.hpp:55
types::OutcomeVector y
Response vector (n) — integer labels (classification) or continuous response (regression).
Definition DataPacket.hpp:23