mlpack  2.0.1
categorical_split_info.hpp
Go to the documentation of this file.
1 
14 #ifndef __MLPACK_METHODS_HOEFFDING_TREES_CATEGORICAL_SPLIT_INFO_HPP
15 #define __MLPACK_METHODS_HOEFFDING_TREES_CATEGORICAL_SPLIT_INFO_HPP
16 
17 #include <mlpack/core.hpp>
18 
19 namespace mlpack {
20 namespace tree {
21 
23 {
24  public:
25  CategoricalSplitInfo(const size_t /* categories */) { }
26 
27  template<typename eT>
28  static size_t CalculateDirection(const eT& value)
29  {
30  // We have a child for each categorical value, and value should be in the
31  // range [0, categories).
32  return size_t(value);
33  }
34 
36  template<typename Archive>
37  void Serialize(Archive& /* ar */, const unsigned int /* version */) { }
38 };
39 
40 } // namespace tree
41 } // namespace mlpack
42 
43 #endif
Linear algebra utility functions, generally performed on matrices or vectors.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
static size_t CalculateDirection(const eT &value)
void Serialize(Archive &, const unsigned int)
Serialize the object. (Nothing needs to be saved.)