#ifndef ROOT_TMVA_CCTreeWrapper
#define ROOT_TMVA_CCTreeWrapper
#ifndef ROOT_TMVA_Event
#include "TMVA/Event.h"
#endif
#ifndef ROOT_TMVA_SeparationBase
#include "TMVA/SeparationBase.h"
#endif
#ifndef ROOT_TMVA_DecisionTree
#include "TMVA/DecisionTree.h"
#endif
namespace TMVA {
class CCTreeWrapper {
public:
typedef std::vector<Event*> EventList;
class CCTreeNode : virtual public Node {
public:
CCTreeNode( DecisionTreeNode* n = NULL );
virtual ~CCTreeNode( );
inline void SetNLeafDaughters( Int_t N ) { fNLeafDaughters = (N > 0 ? N : 0); }
inline Int_t GetNLeafDaughters() const { return fNLeafDaughters; }
inline void SetNodeResubstitutionEstimate( Double_t R ) { fNodeResubstitutionEstimate = (R >= 0 ? R : 0.0); }
inline Double_t GetNodeResubstitutionEstimate( ) const { return fNodeResubstitutionEstimate; }
inline void SetResubstitutionEstimate( Double_t R ) { fResubstitutionEstimate = (R >= 0 ? R : 0.0); }
inline Double_t GetResubstitutionEstimate( ) const { return fResubstitutionEstimate; }
inline void SetAlphaC( Double_t alpha ) { fAlphaC = alpha; }
inline Double_t GetAlphaC( ) const { return fAlphaC; }
inline void SetMinAlphaC( Double_t alpha ) { fMinAlphaC = alpha; }
inline Double_t GetMinAlphaC( ) const { return fMinAlphaC; }
inline DecisionTreeNode* GetDTNode( ) const { return fDTNode; }
inline CCTreeNode* GetLeftDaughter( ) { return dynamic_cast<CCTreeNode*>(GetLeft()); }
inline CCTreeNode* GetRightDaughter( ) { return dynamic_cast<CCTreeNode*>(GetRight()); }
inline CCTreeNode* GetMother( ) { return dynamic_cast<CCTreeNode*>(GetParent()); }
virtual Bool_t ReadDataRecord( std::istream& in );
virtual void Print( ostream& os ) const;
virtual void PrintRec ( ostream& os ) const;
inline virtual Bool_t GoesRight( const Event& e ) const { return (GetDTNode() != NULL ?
GetDTNode()->GoesRight(e) : false); }
inline virtual Bool_t GoesLeft ( const Event& e ) const { return (GetDTNode() != NULL ?
GetDTNode()->GoesLeft(e) : false); }
private:
Int_t fNLeafDaughters;
Double_t fNodeResubstitutionEstimate;
Double_t fResubstitutionEstimate;
Double_t fAlphaC;
Double_t fMinAlphaC;
DecisionTreeNode* fDTNode;
};
CCTreeWrapper( DecisionTree* T, SeparationBase* qualityIndex );
~CCTreeWrapper( );
Double_t CheckEvent( const TMVA::Event & e, Bool_t useYesNoLeaf = false );
Double_t TestTreeQuality( const EventList* validationSample );
void PruneNode( CCTreeNode* t );
void InitTree( CCTreeNode* t );
CCTreeNode* GetRoot() { return fRoot; }
private:
SeparationBase* fQualityIndex;
DecisionTree* fDTParent;
CCTreeNode* fRoot;
};
}
#endif
Last change: Sat Nov 1 10:21:30 2008
Last generated: 2008-11-01 10:21
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.