ROOT  6.06/09
Reference Guide
ResultsMulticlass.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss, Jan Therhaag
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : ResultsMulticlass *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Base-class for result-vectors *
12  * *
13  * Authors (alphabetical): *
14  * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland *
15  * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland *
16  * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland *
17  * Jan Therhaag <Jan.Therhaag@cern.ch> - U of Bonn, Germany *
18  * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, Germany *
19  * *
20  * Copyright (c) 2005-2011: *
21  * CERN, Switzerland *
22  * U. of Victoria, Canada *
23  * MPI-K Heidelberg, Germany *
24  * U. of Bonn, Germany *
25  * *
26  * Redistribution and use in source and binary forms, with or without *
27  * modification, are permitted according to the terms listed in LICENSE *
28  * (http://tmva.sourceforge.net/LICENSE) *
29  **********************************************************************************/
30 
31 #ifndef ROOT_TMVA_ResultsMulticlass
32 #define ROOT_TMVA_ResultsMulticlass
33 
34 //////////////////////////////////////////////////////////////////////////
35 // //
36 // ResultsMulticlass //
37 // //
38 // Class which takes the results of a multiclass classification //
39 // //
40 //////////////////////////////////////////////////////////////////////////
41 
42 #include <vector>
43 
44 #ifndef ROOT_TH1F
45 #include "TH1F.h"
46 #endif
47 #ifndef ROOT_TH2F
48 #include "TH2F.h"
49 #endif
50 
51 #ifndef ROOT_TMVA_Results
52 #include "TMVA/Results.h"
53 #endif
54 #ifndef ROOT_TMVA_Event
55 #include "TMVA/Event.h"
56 #endif
57 #ifndef ROOT_IFitterTarget
58 #include "IFitterTarget.h"
59 #endif
60 
61 namespace TMVA {
62 
63  class MsgLogger;
64 
65  class ResultsMulticlass : public Results, public IFitterTarget {
66 
67  public:
68 
69  ResultsMulticlass( const DataSetInfo* dsi, TString resultsName );
71 
72  // setters
73  void SetValue( std::vector<Float_t>& value, Int_t ievt );
74  void Resize( Int_t entries ) { fMultiClassValues.resize( entries ); }
75  void Clear() { fMultiClassValues.clear(); }
76 
77  // getters
78  Long64_t GetSize() const { return fMultiClassValues.size(); }
79  virtual const std::vector< Float_t >& operator[] ( Int_t ievt ) const { return fMultiClassValues.at(ievt); }
80  std::vector<std::vector< Float_t> >* GetValueVector() { return &fMultiClassValues; }
81 
85  std::vector<Float_t>& GetAchievableEff(){return fAchievableEff;}
86  std::vector<Float_t>& GetAchievablePur(){return fAchievablePur;}
87  // histogramming
88  void CreateMulticlassHistos( TString prefix, Int_t nbins, Int_t nbins_high);
89 
90  Double_t EstimatorFunction( std::vector<Double_t> & );
91  std::vector<Double_t> GetBestMultiClassCuts(UInt_t targetClass);
92 
93  private:
94 
95  mutable std::vector<std::vector< Float_t> > fMultiClassValues; //! mva values (Results)
96  mutable MsgLogger* fLogger; //! message logger
97  MsgLogger& Log() const { return *fLogger; }
99  std::vector<Float_t> fAchievableEff;
100  std::vector<Float_t> fAchievablePur;
101  std::vector<std::vector<Double_t> > fBestCuts;
102  };
103 
104 }
105 
106 #endif
std::vector< std::vector< Float_t > > * GetValueVector()
long long Long64_t
Definition: RtypesCore.h:69
float Float_t
Definition: RtypesCore.h:53
std::vector< Float_t > fAchievablePur
MsgLogger & Log() const
message logger
std::vector< Float_t > & GetAchievableEff()
EAnalysisType
Definition: Types.h:124
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
int nbins[3]
std::vector< std::vector< Double_t > > fBestCuts
Types::EAnalysisType GetAnalysisType()
MsgLogger * fLogger
mva values (Results)
virtual const std::vector< Float_t > & operator[](Int_t ievt) const
ResultsMulticlass(const DataSetInfo *dsi, TString resultsName)
constructor
Long64_t GetSize() const
std::vector< std::vector< Float_t > > fMultiClassValues
void SetValue(std::vector< Float_t > &value, Int_t ievt)
Float_t GetAchievablePur(UInt_t cls)
unsigned int UInt_t
Definition: RtypesCore.h:42
Double_t EstimatorFunction(std::vector< Double_t > &)
void CreateMulticlassHistos(TString prefix, Int_t nbins, Int_t nbins_high)
std::vector< Float_t > fAchievableEff
double Double_t
Definition: RtypesCore.h:55
std::vector< Double_t > GetBestMultiClassCuts(UInt_t targetClass)
Float_t GetAchievableEff(UInt_t cls)
std::vector< Float_t > & GetAchievablePur()
Abstract ClassifierFactory template that handles arbitrary types.
float value
Definition: math.cpp:443
void Resize(Int_t entries)