MethodBayesClassifier.cxx

Go to the documentation of this file.
00001 // @(#)root/tmva $Id: MethodBayesClassifier.cxx 36966 2010-11-26 09:50:13Z evt $    
00002 // Author: Marcin .... 
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  *      Implementation (see header file for description)                          *
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 //_______________________________________________________________________
00029 //                                                                      
00030 // ... description of bayesian classifiers ...
00031 //_______________________________________________________________________
00032 
00033 #include "TMVA/ClassifierFactory.h"
00034 #include "TMVA/MethodBayesClassifier.h"
00035 #include "TMVA/Tools.h"
00036 #include "Riostream.h"
00037 
00038 REGISTER_METHOD(BayesClassifier)
00039 
00040 ClassImp(TMVA::MethodBayesClassifier)
00041 
00042 //_______________________________________________________________________
00043 TMVA::MethodBayesClassifier::MethodBayesClassifier( const TString& jobName,
00044                                                     const TString& methodTitle,
00045                                                     DataSetInfo& theData, 
00046                                                     const TString& theOption,
00047                                                     TDirectory* theTargetDir ) :
00048    TMVA::MethodBase( jobName, Types::kBayesClassifier, methodTitle, theData, theOption, theTargetDir )
00049 {
00050    // standard constructor
00051 }
00052 
00053 //_______________________________________________________________________
00054 TMVA::MethodBayesClassifier::MethodBayesClassifier( DataSetInfo& theData, 
00055                                                     const TString& theWeightFile,  
00056                                                     TDirectory* theTargetDir ) :
00057    TMVA::MethodBase( Types::kBayesClassifier, theData, theWeightFile, theTargetDir ) 
00058 {
00059    // constructor from weight file
00060 }
00061 
00062 //_______________________________________________________________________
00063 Bool_t TMVA::MethodBayesClassifier::HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t /*numberTargets*/ )
00064 {
00065    // Variable can handle classification with 2 classes 
00066    if( type == Types::kClassification && numberClasses == 2 ) return kTRUE;
00067    return kFALSE;
00068 }
00069 
00070 
00071 //_______________________________________________________________________
00072 void TMVA::MethodBayesClassifier::Init( void )
00073 {
00074    // default initialisation
00075 }
00076 
00077 //_______________________________________________________________________
00078 void TMVA::MethodBayesClassifier::DeclareOptions() 
00079 {
00080    // define the options (their key words) that can be set in the option string 
00081 }
00082 
00083 //_______________________________________________________________________
00084 void TMVA::MethodBayesClassifier::ProcessOptions() 
00085 {
00086    // the option string is decoded, for availabel options see "DeclareOptions"
00087 }
00088 
00089 //_______________________________________________________________________
00090 TMVA::MethodBayesClassifier::~MethodBayesClassifier( void )
00091 {
00092    // destructor
00093 }
00094 
00095 //_______________________________________________________________________
00096 void TMVA::MethodBayesClassifier::Train( void )
00097 {
00098    // some training 
00099 }
00100 
00101 //_______________________________________________________________________
00102 void TMVA::MethodBayesClassifier::AddWeightsXMLTo( void* /*parent*/ ) const {
00103    Log() << kFATAL << "Please implement writing of weights as XML" << Endl;
00104 }
00105   
00106 //_______________________________________________________________________
00107 void  TMVA::MethodBayesClassifier::ReadWeightsFromStream( istream & )
00108 {
00109    // read back the training results from a file (stream)
00110 }
00111 
00112 //_______________________________________________________________________
00113 Double_t TMVA::MethodBayesClassifier::GetMvaValue( Double_t* err, Double_t* errUpper )
00114 {
00115    // returns MVA value for given event
00116    Double_t myMVA = 0;
00117 
00118    // cannot determine error
00119    NoErrorCalc(err, errUpper);
00120 
00121    return myMVA;
00122 }
00123 
00124 //_______________________________________________________________________
00125 void TMVA::MethodBayesClassifier::MakeClassSpecific( std::ostream& fout, const TString& className ) const
00126 {
00127    // write specific classifier response
00128    fout << "   // not implemented for class: \"" << className << "\"" << endl;
00129    fout << "};" << endl;
00130 }
00131 
00132 //_______________________________________________________________________
00133 void TMVA::MethodBayesClassifier::GetHelpMessage() const
00134 {
00135    // get help message text
00136    //
00137    // typical length of text line: 
00138    //         "|--------------------------------------------------------------|"
00139    Log() << Endl;
00140    Log() << gTools().Color("bold") << "--- Short description:" << gTools().Color("reset") << Endl;
00141    Log() << Endl;
00142    Log() << "<None>" << Endl;
00143    Log() << Endl;
00144    Log() << gTools().Color("bold") << "--- Performance optimisation:" << gTools().Color("reset") << Endl;
00145    Log() << Endl;
00146    Log() << "<None>" << Endl;
00147    Log() << Endl;
00148    Log() << gTools().Color("bold") << "--- Performance tuning via configuration options:" << gTools().Color("reset") << Endl;
00149    Log() << Endl;
00150    Log() << "<None>" << Endl;
00151 }

Generated on Tue Jul 5 15:25:01 2011 for ROOT_528-00b_version by  doxygen 1.5.1