Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:00

0001 // @(#)root/tmva $Id$
0002 // Author: Abhishek Narain
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : MethodBayesClassifier                                                 *
0008  *                                             *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Bayesian Classifier                                                       *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Abhishek Narain, <narainabhi@gmail.com> - University of Houston           *
0015  *                                                                                *
0016  * Copyright (c) 2005-2006:                                                       *
0017  *      University of Houston,                                                    *
0018  *      CERN, Switzerland                                                         *
0019  *      U. of Victoria, Canada                                                    *
0020  *      MPI-K Heidelberg, Germany                                                 *
0021  *      LAPP, Annecy, France                                                      *
0022  *                                                                                *
0023  * Redistribution and use in source and binary forms, with or without             *
0024  * modification, are permitted according to the terms listed in LICENSE           *
0025  * (see tmva/doc/LICENSE)                                          *
0026  **********************************************************************************/
0027 
0028 #ifndef ROOT_TMVA_MethodBayesClassifier
0029 #define ROOT_TMVA_MethodBayesClassifier
0030 
0031 //////////////////////////////////////////////////////////////////////////
0032 //                                                                      //
0033 // MethodBayesClassifier                                                //
0034 //                                                                      //
0035 // Description...                                                       //
0036 //                                                                      //
0037 //////////////////////////////////////////////////////////////////////////
0038 
0039 #include "TMVA/MethodBase.h"
0040 #include "TMVA/Types.h"
0041 
0042 namespace TMVA {
0043 
0044    class MethodBayesClassifier : public MethodBase {
0045 
0046    public:
0047 
0048       MethodBayesClassifier( const TString& jobName,
0049                              const TString& methodTitle,
0050                              DataSetInfo& theData,
0051                              const TString& theOption = "");
0052 
0053       MethodBayesClassifier( DataSetInfo& theData,
0054                              const TString& theWeightFile);
0055 
0056       virtual ~MethodBayesClassifier( void );
0057 
0058       virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
0059 
0060       // training method
0061       void Train( void );
0062 
0063       using MethodBase::ReadWeightsFromStream;
0064 
0065       // write weights to file
0066       void AddWeightsXMLTo( void* parent ) const;
0067 
0068       // read weights from file
0069       void ReadWeightsFromStream( std::istream& istr );
0070       void ReadWeightsFromXML   ( void* /*wghtnode*/ ) {}
0071 
0072       // calculate the MVA value
0073       Double_t GetMvaValue( Double_t* err = nullptr, Double_t* errUpper = nullptr );
0074 
0075       void Init( void );
0076 
0077       // ranking of input variables
0078       const Ranking* CreateRanking() { return nullptr; }
0079 
0080    protected:
0081 
0082       // make ROOT-independent C++ class for classifier response (classifier-specific implementation)
0083       void MakeClassSpecific( std::ostream&, const TString& ) const;
0084 
0085       // get help message text
0086       void GetHelpMessage() const;
0087 
0088    private:
0089 
0090       // the option handling methods
0091       void DeclareOptions();
0092       void ProcessOptions();
0093 
0094       ClassDef(MethodBayesClassifier,0);  // Friedman's BayesClassifier method
0095    };
0096 
0097 } // namespace TMVA
0098 
0099 #endif // MethodBayesClassifier_H