MethodBayesClassifier.h

Go to the documentation of this file.
00001 // @(#)root/tmva $Id: MethodBayesClassifier.h 36966 2010-11-26 09:50:13Z evt $    
00002 // Author: Abhishek Narain
00003 
00004 /**********************************************************************************
00005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
00006  * Package: TMVA                                                                  *
00007  * Class  : MethodBayesClassifier                                                 *
00008  * Web    : http://tmva.sourceforge.net                                           *
00009  *                                                                                *
00010  * Description:                                                                   *
00011  *      Bayesian Classifier                                                       *
00012  *                                                                                *
00013  * Authors (alphabetical):                                                        *
00014  *      Abhishek Narain, <narainabhi@gmail.com> - University of Houston           *
00015  *                                                                                *
00016  * Copyright (c) 2005-2006:                                                       *
00017  *      University of Houston,                                                    *
00018  *      CERN, Switzerland                                                         *
00019  *      U. of Victoria, Canada                                                    *
00020  *      MPI-K Heidelberg, Germany                                                 *
00021  *      LAPP, Annecy, France                                                      *
00022  *                                                                                *
00023  * Redistribution and use in source and binary forms, with or without             *
00024  * modification, are permitted according to the terms listed in LICENSE           *
00025  * (http://tmva.sourceforge.net/LICENSE)                                          *
00026  **********************************************************************************/
00027 
00028 #ifndef ROOT_TMVA_MethodBayesClassifier
00029 #define ROOT_TMVA_MethodBayesClassifier
00030 
00031 //////////////////////////////////////////////////////////////////////////
00032 //                                                                      //
00033 // MethodBayesClassifier                                                //
00034 //                                                                      //
00035 // Description...                                                       //
00036 //                                                                      //
00037 //////////////////////////////////////////////////////////////////////////
00038 
00039 #ifndef ROOT_TMVA_MethodBase
00040 #include "TMVA/MethodBase.h"
00041 #endif
00042 #ifndef ROOT_TMVA_Types
00043 #include "TMVA/Types.h"
00044 #endif
00045 
00046 namespace TMVA {
00047 
00048    class MethodBayesClassifier : public MethodBase {
00049 
00050    public:
00051 
00052       MethodBayesClassifier( const TString& jobName, 
00053                              const TString& methodTitle, 
00054                              DataSetInfo& theData,
00055                              const TString& theOption = "",
00056                              TDirectory* theTargetDir = 0 );
00057       
00058       MethodBayesClassifier( DataSetInfo& theData, 
00059                              const TString& theWeightFile,  
00060                              TDirectory* theTargetDir = NULL );
00061       
00062       virtual ~MethodBayesClassifier( void );
00063     
00064       virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
00065 
00066       // training method
00067       void Train( void );
00068 
00069       using MethodBase::ReadWeightsFromStream;
00070 
00071       // write weights to file
00072       void AddWeightsXMLTo( void* parent ) const;
00073 
00074       // read weights from file
00075       void ReadWeightsFromStream( istream& istr );
00076       void ReadWeightsFromXML   ( void* /*wghtnode*/ ) {}
00077 
00078       // calculate the MVA value
00079       Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
00080 
00081       void Init( void );
00082 
00083       // ranking of input variables
00084       const Ranking* CreateRanking() { return 0; }
00085 
00086    protected:
00087 
00088       // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
00089       void MakeClassSpecific( std::ostream&, const TString& ) const;
00090 
00091       // get help message text
00092       void GetHelpMessage() const;
00093 
00094    private:
00095 
00096       // the option handling methods
00097       void DeclareOptions();
00098       void ProcessOptions();
00099 
00100       ClassDef(MethodBayesClassifier,0)  // Friedman's BayesClassifier method 
00101    };
00102 
00103 } // namespace TMVA
00104 
00105 #endif // MethodBayesClassifier_H

Generated on Tue Jul 5 14:27:30 2011 for ROOT_528-00b_version by  doxygen 1.5.1