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 
17 namespace mlpack {
18 namespace 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 uint32_t /* version */) { }
36 };
37 
38 } // namespace tree
39 } // namespace mlpack
40 
41 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
void serialize(Archive &, const uint32_t)
Serialize the object. (Nothing needs to be saved.)
static size_t CalculateDirection(const eT &value)