[mlpack-git] master: A base class for information after the split has been made. (3385f80)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Wed Dec 23 11:41:59 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/de9cc4b05069e1fa4793d9355f2f595af5ff45d2...6070527af14296cd99739de6c62666cc5d2a2125

>---------------------------------------------------------------

commit 3385f8012e842ff014faff5a6764ced544be42a4
Author: Ryan Curtin <ryan at ratml.org>
Date:   Mon Sep 21 12:30:09 2015 +0000

    A base class for information after the split has been made.


>---------------------------------------------------------------

3385f8012e842ff014faff5a6764ced544be42a4
 .../hoeffding_trees/categorical_split_info.hpp     | 35 ++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/src/mlpack/methods/hoeffding_trees/categorical_split_info.hpp b/src/mlpack/methods/hoeffding_trees/categorical_split_info.hpp
new file mode 100644
index 0000000..965f128
--- /dev/null
+++ b/src/mlpack/methods/hoeffding_trees/categorical_split_info.hpp
@@ -0,0 +1,35 @@
+/**
+ * @file categorical_split_info.hpp
+ * @author Ryan Curtin
+ *
+ * After a categorical split has been made, this holds information on the split.
+ */
+#ifndef __MLPACK_METHODS_HOEFFDING_TREES_CATEGORICAL_SPLIT_INFO_HPP
+#define __MLPACK_METHODS_HOEFFDING_TREES_CATEGORICAL_SPLIT_INFO_HPP
+
+#include <mlpack/core.hpp>
+
+namespace mlpack {
+namespace tree {
+
+class CategoricalSplitInfo
+{
+ public:
+  CategoricalSplitInfo(const size_t categories) : categories(categories) { }
+
+  template<typename eT>
+  void CalculateDirection(const eT& value)
+  {
+    // We have a child for each categorical value, and value should be in the
+    // range [0, categories).
+    return value;
+  }
+
+ private:
+  const size_t categories;
+};
+
+} // namespace tree
+} // namespace mlpack
+
+#endif



More information about the mlpack-git mailing list