16#if defined(EIGEN_VERSION_AT_LEAST) && !EIGEN_VERSION_AT_LEAST(3, 4, 0)
17#error "ppforest2 requires Eigen >= 3.4.0. Update Eigen (or RcppEigen for the R package)."
43 using FeatureMatrix = Eigen::Matrix<Feature, Eigen::Dynamic, Eigen::Dynamic>;
59 using Names = std::vector<std::string>;
62 template<
typename T>
using Matrix = Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic>;
65 template<
typename T>
using Vector = Eigen::Matrix<T, Eigen::Dynamic, 1>;
91 if (s ==
"classification") {
95 if (s ==
"regression") {
99 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:32
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:59
bool is_classification(Mode mode)
Whether mode is Classification.
Definition Types.hpp:71
std::string to_string(Mode mode)
Canonical string form of a training mode.
Definition Types.hpp:83
Eigen::Matrix< Feature, Eigen::Dynamic, Eigen::Dynamic > FeatureMatrix
Dynamic-size matrix of feature values.
Definition Types.hpp:43
Eigen::Matrix< Outcome, Eigen::Dynamic, 1 > OutcomeVector
Dynamic-size column vector of predictions.
Definition Types.hpp:52
bool is_regression(Mode mode)
Whether mode is Regression.
Definition Types.hpp:76
Eigen::Matrix< GroupId, Eigen::Dynamic, 1 > GroupIdVector
Dynamic-size column vector of internal group labels.
Definition Types.hpp:49
Eigen::Matrix< Feature, Eigen::Dynamic, 1 > FeatureVector
Dynamic-size column vector of feature values.
Definition Types.hpp:46
Mode mode_from_string(std::string_view s)
Training mode from string.
Definition Types.hpp:90
Feature Outcome
Scalar type for predictions (float for both classification and regression).
Definition Types.hpp:40
Eigen::Matrix< T, Eigen::Dynamic, 1 > Vector
Generic dynamic-size column vector.
Definition Types.hpp:65
int GroupId
Scalar type for internal group labels (integer). Used as map keys, set elements, and partition indice...
Definition Types.hpp:37
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > Matrix
Generic dynamic-size matrix.
Definition Types.hpp:62
Mode
Training mode.
Definition Types.hpp:68
@ Classification
Definition Types.hpp:68
@ Regression
Definition Types.hpp:68
float Feature
Scalar type for feature values.
Definition Types.hpp:34