26 static std::string
value() {
return "unknown"; };
30 static std::string
value() {
return "d"; }
34 static std::string
value() {
return "f"; }
38 static std::string
value() {
return "ui"; }
42 static std::string
value() {
return "ui8"; }
46 static std::string
value() {
return "i16"; }
50 static std::string
value() {
return "i"; }
54 template <
typename DT>
55 using Mat = Eigen::Matrix<DT, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor>;
58 template <
typename DT>
60 Eigen::Matrix<DT, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor>;
63 template <
typename DT>
64 using MatCRef = Eigen::Ref<const Mat<DT>>;
67 template <
typename DT>
71 template <
typename DT>
75 template <
typename DT>
76 using Vec = Eigen::Matrix<DT, Eigen::Dynamic, 1, Eigen::ColMajor>;
78 template <
typename DT>
79 using VecRM = Eigen::Matrix<DT, 1, Eigen::Dynamic, Eigen::RowMajor>;
81 template <
typename DT>
84 template <
typename DT>
87 template <
typename DT>
88 using VecCRef = Eigen::Ref<const Vec<DT>>;
90 template <
typename DT>
92 Eigen::Map<const Eigen::Matrix<DT, 1, Eigen::Dynamic, Eigen::RowMajor>,
93 Eigen::Unaligned, Eigen::InnerStride<>>;
111 typedef std::function<id_t(const Data<MatCRef> &,
const id_t &,
112 const std::function<void(void *)> &)>
118 template <
typename FT>
127 stream <<
"forpy::SplitOptRes_X[<=" <<
self.thresh
128 <<
"; gain: " <<
self.gain <<
", valid: " <<
self.valid <<
"]";
154 inline TodoMark(std::shared_ptr<std::vector<id_t>> sample_ids,
155 const interv_t &interv,
const id_t &node_id,
157 : sample_ids(sample_ids),
161 std::shared_ptr<std::vector<id_t>>
sample_ids;
171 stream <<
"forpy::TodoMark[node_id: " <<
self.node_id <<
", depth " 172 <<
self.depth <<
"]";
178 friend class cereal::access;
179 template <
class Archive>
181 ar(CEREAL_NVP(sample_ids), CEREAL_NVP(interv), CEREAL_NVP(node_id),
190 typedef std::vector<std::pair<std::shared_ptr<std::vector<size_t>>,
191 std::shared_ptr<std::vector<float>
const>>>
210 #pragma clang diagnostic push 211 #pragma clang diagnostic ignored "-Wunused-variable" 213 #pragma clang diagnostic pop 216 #endif // FORPY_TYPES_H_ std::pair< std::shared_ptr< std::vector< id_t > >, id_t > include_pair_t
A pair containing information about newly included samples.
static std::string value()
Eigen::Map< const Eigen::Matrix< DT, 1, Eigen::Dynamic, Eigen::RowMajor >, Eigen::Unaligned, Eigen::InnerStride<>> VecCMap
#define MOVE_ASSIGN(TypeName)
Eigen::Ref< VecRM< DT >> VecRMRef
#define DISALLOW_COPY_AND_ASSIGN(TypeName)
size_t id_t
Element id type.
const MatCRef< float > FORPY_ZERO_MATR(Mat< float >::Zero(0, 1))
std::vector< std::pair< std::shared_ptr< std::vector< size_t > >, std::shared_ptr< std::vector< float > const > > > usage_map_t
Describes how each sample is used for each tree.
bool operator==(SplitOptRes< FT > const &rhs) const
Eigen::Ref< const Vec< DT >> VecCRef
std::pair< id_t, id_t > interv_t
void serialize(Archive &ar, const uint &)
std::pair< ptrdiff_t, ptrdiff_t > regint_t
TodoMark(std::shared_ptr< std::vector< id_t >> sample_ids, const interv_t &interv, const id_t &node_id, const uint &depth)
Stores the parameters for one marked tree node.
Eigen::Ref< const Mat< DT >> MatCRef
Parameterized const matrix ref type.
friend std::ostream & operator<<(std::ostream &stream, const TodoMark &self)
std::unordered_set< std::vector< size_t >, vector_hasher > proposal_set_t
The type of a set of dimension selections.
static std::string value()
Eigen::Ref< Vec< DT >> VecRef
Eigen::Ref< const MatCM< DT >> MatCMCRef
Parameterized const matrix column major matrix ref type.
bool operator==(TodoMark const &rhs) const
static std::string value()
Eigen::Matrix< DT, Eigen::Dynamic, Eigen::Dynamic, Eigen::ColMajor > MatCM
Parameterized column major matrix type.
std::shared_ptr< std::vector< id_t > > sample_ids
mu::variant< SplitOptRes< float >, SplitOptRes< double >, SplitOptRes< uint >, SplitOptRes< uint8_t > > OptSplitV
EThresholdSelection
Specifies which thresholds should be used for a decision.
static std::string value()
Struct for translating primitive types to a short name.
Eigen::Ref< Mat< DT >> MatRef
Parameterized standard non-const matrix ref type.
Eigen::Matrix< DT, Eigen::Dynamic, 1, Eigen::ColMajor > Vec
Eigen::Matrix< DT, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Mat
Parameterized Matrix type (row major).
static std::string value()
A simple vector<size_t> hasher.
friend std::ostream & operator<<(std::ostream &stream, const SplitOptRes< FT > &self)
static std::string value()
ECompletionLevel
Specifies the completion level for one training step.
unsigned int uint
Convenience typedef for unsigned int.
Eigen::Matrix< DT, 1, Eigen::Dynamic, Eigen::RowMajor > VecRM
std::function< id_t(const Data< MatCRef > &, const id_t &, const std::function< void(void *)> &)> node_predf
static std::string value()