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