Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
9 * *
10 * Description: *
11 * Derived-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 * (see tmva/doc/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 "TH1F.h"
43#include "TH2F.h"
44
45#include "TMVA/Results.h"
46#include "TMVA/Event.h"
47#include "IFitterTarget.h"
48
49#include <vector>
50
51namespace TMVA {
52
53class MsgLogger;
54
55class ResultsMulticlass : public Results, public IFitterTarget {
56
57public:
58 ResultsMulticlass(const DataSetInfo *dsi, TString resultsName);
60
61 // setters
62 void SetValue(std::vector<Float_t> &value, Int_t ievt);
63 void Resize(Int_t entries) { fMultiClassValues.resize(entries); }
64 using TObject::Clear;
65 void Clear(Option_t *) override { fMultiClassValues.clear(); }
66
67 // getters
68 Long64_t GetSize() const { return fMultiClassValues.size(); }
69 const std::vector<Float_t> &operator[](Int_t ievt) const override { return fMultiClassValues.at(ievt); }
70 std::vector<std::vector<Float_t>> *GetValueVector() { return &fMultiClassValues; }
71
75 std::vector<Float_t> &GetAchievableEff() { return fAchievableEff; }
76 std::vector<Float_t> &GetAchievablePur() { return fAchievablePur; }
77
79
80 // histogramming
82 void CreateMulticlassHistos(TString prefix, Int_t nbins, Int_t nbins_high);
83
84 Double_t EstimatorFunction(std::vector<Double_t> &) override;
85 std::vector<Double_t> GetBestMultiClassCuts(UInt_t targetClass);
86
87private:
88 mutable std::vector<std::vector<Float_t>> fMultiClassValues; ///< mva values (Results)
89 mutable MsgLogger *fLogger; ///<! message logger
90 MsgLogger &Log() const { return *fLogger; }
92 std::vector<Float_t> fAchievableEff;
93 std::vector<Float_t> fAchievablePur;
94 std::vector<std::vector<Double_t>> fBestCuts;
95
96 // Temporary storage used during GetBestMultiClassCuts
97 std::vector<Float_t> fClassSumWeights;
98 std::vector<Float_t> fEventWeights;
99 std::vector<UInt_t> fEventClasses;
100
101protected:
103};
104
105} // namespace TMVA
106
107#endif
unsigned int UInt_t
Definition RtypesCore.h:46
float Float_t
Definition RtypesCore.h:57
double Double_t
Definition RtypesCore.h:59
long long Long64_t
Definition RtypesCore.h:80
const char Option_t
Definition RtypesCore.h:66
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Class that contains all the data information.
Definition DataSetInfo.h:62
Interface for a fitter 'target'.
ostringstream derivative to redirect and format output
Definition MsgLogger.h:57
Class which takes the results of a multiclass classification.
void Resize(Int_t entries)
std::vector< Float_t > fEventWeights
Types::EAnalysisType GetAnalysisType() override
TMatrixD GetConfusionMatrix(Double_t effB)
Returns a confusion matrix where each class is pitted against each other.
MsgLogger * fLogger
! message logger
Double_t EstimatorFunction(std::vector< Double_t > &) override
std::vector< UInt_t > fEventClasses
std::vector< Float_t > & GetAchievableEff()
Float_t GetAchievablePur(UInt_t cls)
std::vector< Float_t > & GetAchievablePur()
MsgLogger & Log() const
std::vector< Double_t > GetBestMultiClassCuts(UInt_t targetClass)
calculate the best working point (optimal cut values) for the multiclass classifier
std::vector< Float_t > fAchievableEff
std::vector< std::vector< Double_t > > fBestCuts
void CreateMulticlassHistos(TString prefix, Int_t nbins, Int_t nbins_high)
this function fills the mva response histos for multiclass classification
std::vector< std::vector< Float_t > > fMultiClassValues
mva values (Results)
Float_t GetAchievableEff(UInt_t cls)
const std::vector< Float_t > & operator[](Int_t ievt) const override
std::vector< Float_t > fAchievablePur
std::vector< std::vector< Float_t > > * GetValueVector()
std::vector< Float_t > fClassSumWeights
void CreateMulticlassPerformanceHistos(TString prefix)
Create performance graphs for this classifier a multiclass setting.
void Clear(Option_t *) override
void SetValue(std::vector< Float_t > &value, Int_t ievt)
Class that is the base-class for a vector of result.
Definition Results.h:57
@ kMulticlass
Definition Types.h:129
virtual void Clear(Option_t *="")
Definition TObject.h:119
Basic string class.
Definition TString.h:139
create variable transformations