Logo ROOT   6.18/05
Reference Guide
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
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
44
46 private:
49 VIType fType {kShort};
50 public:
51 explicit VariableImportance(DataLoader *loader);
53
54 virtual void Evaluate();
55
56 void SetType(VIType type){fType=type;}
57 VIType GetType(){return fType;}
58
59 const VariableImportanceResult& GetResults() const {return fResults;}//I need to think about this, which is the best way to get the results?
60 protected:
61 //evaluate the simple case that is removing 1 variable at time
63 //evaluate all variables combinations NOTE: use with care in huge datasets with a huge number of variables
65 //evaluate randomly given a number of seeds
67
68 //method to return a nice histogram with the results ;)
69 TH1F* GetImportance(const UInt_t nbits,std::vector<Float_t> &importances,std::vector<TString> &varNames);
70
71 //method to compute the range(number total of operations for every bit configuration)
73
74 private:
75 std::unique_ptr<Factory> fClassifier;
77 };
78}
79
80
81#endif
unsigned int UInt_t
Definition: RtypesCore.h:42
unsigned long ULong_t
Definition: RtypesCore.h:51
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
int type
Definition: TGX11.cxx:120
The Canvas class.
Definition: TCanvas.h:31
1-D histogram with a float per channel (see TH1 documentation)}
Definition: TH1.h:571
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:36
std::shared_ptr< TH1F > fImportanceHist
TCanvas * Draw(const TString name="VariableImportance") const
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
VariableImportance(DataLoader *loader)
TH1F * GetImportance(const UInt_t nbits, std::vector< Float_t > &importances, std::vector< TString > &varNames)
Basic string class.
Definition: TString.h:131
create variable transformations