00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2012 Chiyuan Zhang 00008 * Copyright (C) 2012 Chiyuan Zhang 00009 */ 00010 00011 #ifndef BALANCEDCONDITIONALPROBABILITYTREE_H__ 00012 #define BALANCEDCONDITIONALPROBABILITYTREE_H__ 00013 00014 #include <shogun/multiclass/tree/ConditionalProbabilityTree.h> 00015 00016 namespace shogun 00017 { 00018 00035 class CBalancedConditionalProbabilityTree: public CConditionalProbabilityTree 00036 { 00037 public: 00039 CBalancedConditionalProbabilityTree(); 00040 00042 virtual ~CBalancedConditionalProbabilityTree() {} 00043 00045 virtual const char* get_name() const { return "BalancedConditionalProbabilityTree"; } 00046 00048 void set_alpha(float64_t alpha); 00049 00051 float64_t get_alpha() const { return m_alpha; } 00052 00053 protected: 00059 virtual bool which_subtree(node_t *node, SGVector<float32_t> ex); 00060 00061 private: 00062 int32_t tree_depth(node_t *node); 00063 00064 float64_t m_alpha; 00065 }; 00066 00067 } /* shogun */ 00068 00069 #endif /* end of include guard: BALANCEDCONDITIONALPROBABILITYTREE_H__ */ 00070