33 using FeatureMatrix = Eigen::Matrix<Feature, Eigen::Dynamic, Eigen::Dynamic>;
49 using Names = std::vector<std::string>;
52 template<
typename T>
using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
55 template<
typename T>
using Vector = Eigen::Matrix<T, Eigen::Dynamic, 1>;
81 if (s ==
"classification") {
85 if (s ==
"regression") {
89 throw UserError(
"Invalid mode '" + std::string(s) +
"'. Expected 'classification' or 'regression'.");
Exception type for user-facing input validation errors.
Exception for user-facing input validation errors.
Definition UserError.hpp:25
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
bool is_classification(Mode mode)
Whether mode is Classification.
Definition Types.hpp:61
std::string to_string(Mode mode)
Canonical string form of a training mode.
Definition Types.hpp:73
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
bool is_regression(Mode mode)
Whether mode is Regression.
Definition Types.hpp:66
Eigen::Matrix< GroupId, Eigen::Dynamic, 1 > GroupIdVector
Dynamic-size column vector of internal group labels.
Definition Types.hpp:39
Eigen::Matrix< Feature, Eigen::Dynamic, 1 > FeatureVector
Dynamic-size column vector of feature values.
Definition Types.hpp:36
Mode mode_from_string(std::string_view s)
Training mode from string.
Definition Types.hpp:80
Feature Outcome
Scalar type for predictions (float for both classification and regression).
Definition Types.hpp:30
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
Generic dynamic-size column vector.
Definition Types.hpp:55
int GroupId
Scalar type for internal group labels (integer). Used as map keys, set elements, and partition indice...
Definition Types.hpp:27
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
Generic dynamic-size matrix.
Definition Types.hpp:52
Mode
Training mode.
Definition Types.hpp:58
@ Classification
Definition Types.hpp:58
@ Regression
Definition Types.hpp:58
float Feature
Scalar type for feature values.
Definition Types.hpp:24