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 void Evaluate() override;
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 int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
unsigned long ULong_t
Unsigned long integer 4 bytes (unsigned long). Size depends on architecture.
Definition RtypesCore.h:69
#define ClassDefOverride(name, id)
Definition Rtypes.h:348
char name[80]
Definition TGX11.cxx:148
The Canvas class.
Definition TCanvas.h:23
1-D histogram with a float per channel (see TH1 documentation)
Definition TH1.h:878
Envelope(const TString &name, DataLoader *dataloader=nullptr, TFile *file=nullptr, const TString options="")
Constructor for the initialization of Envelopes, differents Envelopes may needs differents constructo...
Definition Envelope.cxx:40
class to storage options for the differents methods
Definition OptionMap.h:34
std::shared_ptr< TH1F > fImportanceHist
void Evaluate() override
Virtual method to be implemented with your algorithm.
std::unique_ptr< Factory > fClassifier
const VariableImportanceResult & GetResults() const
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:138
create variable transformations
th1 Draw()