Logo ROOT   6.07/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  using TObject::Clear;
76  virtual void Clear(Option_t *) { fMultiClassValues.clear(); }
77 
78  // getters
79  Long64_t GetSize() const { return fMultiClassValues.size(); }
80  virtual const std::vector< Float_t >& operator[] ( Int_t ievt ) const { return fMultiClassValues.at(ievt); }
81  std::vector<std::vector< Float_t> >* GetValueVector() { return &fMultiClassValues; }
82 
86  std::vector<Float_t>& GetAchievableEff(){return fAchievableEff;}
87  std::vector<Float_t>& GetAchievablePur(){return fAchievablePur;}
88  // histogramming
89  void CreateMulticlassHistos( TString prefix, Int_t nbins, Int_t nbins_high);
90 
91  Double_t EstimatorFunction( std::vector<Double_t> & );
92  std::vector<Double_t> GetBestMultiClassCuts(UInt_t targetClass);
93 
94  private:
95 
96  mutable std::vector<std::vector< Float_t> > fMultiClassValues; // mva values (Results)
97  mutable MsgLogger* fLogger; // message logger
98  MsgLogger& Log() const { return *fLogger; }
100  std::vector<Float_t> fAchievableEff;
101  std::vector<Float_t> fAchievablePur;
102  std::vector<std::vector<Double_t> > fBestCuts;
103  protected:
104 
106 
107  };
108 
109 }
110 
111 #endif
virtual void Clear(Option_t *="")
Definition: TObject.h:96
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
const char Option_t
Definition: RtypesCore.h:62
MsgLogger & Log() const
std::vector< Float_t > & GetAchievableEff()
EAnalysisType
Definition: Types.h:128
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()
#define ClassDef(name, id)
Definition: Rtypes.h:254
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.
virtual void Clear(Option_t *)
void Resize(Int_t entries)