mlpack 3.4.2
categorical_split_info.hpp
Go to the documentation of this file.
1
12#ifndef MLPACK_METHODS_HOEFFDING_TREES_CATEGORICAL_SPLIT_INFO_HPP
13#define MLPACK_METHODS_HOEFFDING_TREES_CATEGORICAL_SPLIT_INFO_HPP
14
15#include <mlpack/prereqs.hpp>
16
17namespace mlpack {
18namespace tree {
19
21{
22 public:
23 CategoricalSplitInfo(const size_t /* categories */) { }
24
25 template<typename eT>
26 static size_t CalculateDirection(const eT& value)
27 {
28 // We have a child for each categorical value, and value should be in the
29 // range [0, categories).
30 return size_t(value);
31 }
32
34 template<typename Archive>
35 void serialize(Archive& /* ar */, const unsigned int /* version */) { }
36};
37
38} // namespace tree
39} // namespace mlpack
40
41#endif
void serialize(Archive &, const unsigned int)
Serialize the object. (Nothing needs to be saved.)
static size_t CalculateDirection(const eT &value)
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.