Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
VariableImportance.h
Go to the documentation of this file.
1// @(#)root/tmva $Id$
2// Author: Omar Zapata and Sergei Gleyzer. 2016
3
4
5#ifndef ROOT_TMVA_VariableImportance
6#define ROOT_TMVA_VariableImportance
7
8
9#include "TString.h"
10#include <vector>
11
12#include "TMVA/Configurable.h"
13#include "TMVA/Types.h"
14
15#include <TMVA/Factory.h>
16
17#include <TMVA/DataLoader.h>
18
19#include <TMVA/OptionMap.h>
20
21#include <TMVA/Envelope.h>
22
23namespace TMVA {
24
26 {
27 friend class VariableImportance;
28 private:
30 std::shared_ptr<TH1F> fImportanceHist;
31 VIType fType {kShort};
32 public:
36
39 void Print() const ;
40
41 TCanvas* Draw(const TString name="VariableImportance") const;
42 };
43
45 private:
48 VIType fType {kShort};
49 public:
50 explicit VariableImportance(DataLoader *loader);
52
53 virtual void Evaluate();
54
55 void SetType(VIType type){fType=type;}
56 VIType GetType(){return fType;}
57
58 const VariableImportanceResult& GetResults() const {return fResults;}//I need to think about this, which is the best way to get the results?
59 protected:
60 //evaluate the simple case that is removing 1 variable at time
62 //evaluate all variables combinations NOTE: use with care in huge datasets with a huge number of variables
64 //evaluate randomly given a number of seeds
66
67 //method to return a nice histogram with the results ;)
68 TH1F* GetImportance(const UInt_t nbits,std::vector<Float_t> &importances,std::vector<TString> &varNames);
69
70 //method to compute the range(number total of operations for every bit configuration)
72
73 private:
74 std::unique_ptr<Factory> fClassifier;
76 };
77}
78
79
80#endif
unsigned long ULong_t
Definition RtypesCore.h:55
unsigned int UInt_t
Definition RtypesCore.h:46
#define ClassDef(name, id)
Definition Rtypes.h:337
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
char name[80]
Definition TGX11.cxx:110
The Canvas class.
Definition TCanvas.h:23
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:621
Abstract base class for all high level ml algorithms, you can book ml methods like BDT,...
Definition Envelope.h:44
class to storage options for the differents methods
Definition OptionMap.h:34
std::shared_ptr< TH1F > fImportanceHist
std::unique_ptr< Factory > fClassifier
const VariableImportanceResult & GetResults() const
virtual void Evaluate()
Virtual method to be implemented with your algorithm.
void EvaluateImportanceRandom(UInt_t nseeds)
VariableImportanceResult fResults
TH1F * GetImportance(const UInt_t nbits, std::vector< Float_t > &importances, std::vector< TString > &varNames)
Basic string class.
Definition TString.h:139
create variable transformations
th1 Draw()