ROOT  6.06/09
Reference Guide
Classes | Public Member Functions | Protected Types | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
TMVA::RuleFitAPI Class Reference

Definition at line 50 of file RuleFitAPI.h.

Classes

struct  IntParms
 
struct  RealParms
 

Public Member Functions

 RuleFitAPI (const TMVA::MethodRuleFit *rfbase, TMVA::RuleFit *rulefit, EMsgType minType)
 
virtual ~RuleFitAPI ()
 destructor More...
 
void WelcomeMessage ()
 welcome message More...
 
void HowtoSetupRF ()
 howto message More...
 
void SetRFWorkDir (const char *wdir)
 set the directory containing rf_go.exe. More...
 
void CheckRFWorkDir ()
 check if the rulefit work dir is properly setup. More...
 
void TrainRuleFit ()
 
void TestRuleFit ()
 
void VarImp ()
 
Bool_t ReadModelSum ()
 read model from rulefit.sum More...
 
const TString GetRFWorkDir () const
 

Protected Types

enum  ERFMode { kRfRegress =1, kRfClass =2 }
 
enum  EModel { kRfLinear =0, kRfRules =1, kRfBoth =2 }
 
enum  ERFProgram { kRfTrain =0, kRfPredict, kRfVarimp }
 

Protected Member Functions

void InitRuleFit ()
 default initialisation SetRFWorkDir("./rulefit"); More...
 
void FillRealParmsDef ()
 set default real params More...
 
void FillIntParmsDef ()
 set default int params More...
 
void ImportSetup ()
 import setup from MethodRuleFit More...
 
void SetTrainParms ()
 set the training parameters More...
 
void SetTestParms ()
 set the test params More...
 
Int_t RunRuleFit ()
 execute rf_go.exe More...
 
void SetRFTrain ()
 
void SetRFPredict ()
 
void SetRFVarimp ()
 
TString GetRFName (TString name)
 
Bool_t OpenRFile (TString name, std::ofstream &f)
 
Bool_t OpenRFile (TString name, std::ifstream &f)
 
Bool_t WriteInt (std::ofstream &f, const Int_t *v, Int_t n=1)
 
Bool_t WriteFloat (std::ofstream &f, const Float_t *v, Int_t n=1)
 
Int_t ReadInt (std::ifstream &f, Int_t *v, Int_t n=1) const
 
Int_t ReadFloat (std::ifstream &f, Float_t *v, Int_t n=1) const
 
Bool_t WriteAll ()
 write all files read by rf_go.exe More...
 
Bool_t WriteIntParms ()
 write int params file More...
 
Bool_t WriteRealParms ()
 write int params file More...
 
Bool_t WriteLx ()
 Save input variable mask. More...
 
Bool_t WriteProgram ()
 write command to rf_go.exe More...
 
Bool_t WriteRealVarImp ()
 write the minimum importance to be considered More...
 
Bool_t WriteRfOut ()
 written by rf_go.exe; write rulefit output (rfout) More...
 
Bool_t WriteRfStatus ()
 written by rf_go.exe; write rulefit status More...
 
Bool_t WriteRuleFitMod ()
 written by rf_go.exe (NOTE:Format unknown!) More...
 
Bool_t WriteRuleFitSum ()
 written by rf_go.exe (NOTE: format unknown!) More...
 
Bool_t WriteTrain ()
 write training data, columnwise More...
 
Bool_t WriteVarNames ()
 write variable names, ascii More...
 
Bool_t WriteVarImp ()
 
Bool_t WriteYhat ()
 written by rf_go.exe More...
 
Bool_t WriteTest ()
 Write test data. More...
 
Bool_t ReadYhat ()
 read the score More...
 
Bool_t ReadIntParms ()
 
Bool_t ReadRealParms ()
 
Bool_t ReadLx ()
 
Bool_t ReadProgram ()
 
Bool_t ReadRealVarImp ()
 
Bool_t ReadRfOut ()
 
Bool_t ReadRfStatus ()
 
Bool_t ReadRuleFitMod ()
 
Bool_t ReadRuleFitSum ()
 
Bool_t ReadTrainX ()
 
Bool_t ReadTrainY ()
 
Bool_t ReadTrainW ()
 
Bool_t ReadVarNames ()
 
Bool_t ReadVarImp ()
 read variable importance More...
 

Private Member Functions

 RuleFitAPI ()
 

Private Attributes

const MethodRuleFitfMethodRuleFit
 
RuleFitfRuleFit
 
std::vector< Float_tfRFYhat
 
std::vector< Float_tfRFVarImp
 
std::vector< Int_tfRFVarImpInd
 
TString fRFWorkDir
 
IntParms fRFIntParms
 
RealParms fRFRealParms
 
std::vector< int > fRFLx
 
ERFProgram fRFProgram
 
TString fModelType
 
MsgLogger fLogger
 

#include <TMVA/RuleFitAPI.h>

+ Collaboration diagram for TMVA::RuleFitAPI:

Member Enumeration Documentation

enum TMVA::RuleFitAPI::EModel
protected
Enumerator
kRfLinear 
kRfRules 
kRfBoth 

Definition at line 84 of file RuleFitAPI.h.

enum TMVA::RuleFitAPI::ERFMode
protected
Enumerator
kRfRegress 
kRfClass 

Definition at line 83 of file RuleFitAPI.h.

Enumerator
kRfTrain 
kRfPredict 
kRfVarimp 

Definition at line 85 of file RuleFitAPI.h.

Constructor & Destructor Documentation

TMVA::RuleFitAPI::RuleFitAPI ( const TMVA::MethodRuleFit rfbase,
TMVA::RuleFit rulefit,
EMsgType  minType 
)
TMVA::RuleFitAPI::~RuleFitAPI ( )
virtual

destructor

Definition at line 66 of file RuleFitAPI.cxx.

TMVA::RuleFitAPI::RuleFitAPI ( )
private

Member Function Documentation

void TMVA::RuleFitAPI::CheckRFWorkDir ( )

check if the rulefit work dir is properly setup.

it aborts (kFATAL) if not.

Check existance of directory

Definition at line 163 of file RuleFitAPI.cxx.

void TMVA::RuleFitAPI::FillIntParmsDef ( )
protected

set default int params

Definition at line 225 of file RuleFitAPI.cxx.

void TMVA::RuleFitAPI::FillRealParmsDef ( )
protected

set default real params

Definition at line 210 of file RuleFitAPI.cxx.

TString TMVA::RuleFitAPI::GetRFName ( TString  name)
inlineprotected

Definition at line 230 of file RuleFitAPI.h.

const TString TMVA::RuleFitAPI::GetRFWorkDir ( ) const
inline

Definition at line 79 of file RuleFitAPI.h.

void TMVA::RuleFitAPI::HowtoSetupRF ( )

howto message

Definition at line 89 of file RuleFitAPI.cxx.

void TMVA::RuleFitAPI::ImportSetup ( )
protected

import setup from MethodRuleFit

Definition at line 129 of file RuleFitAPI.cxx.

void TMVA::RuleFitAPI::InitRuleFit ( )
protected

default initialisation SetRFWorkDir("./rulefit");

Definition at line 119 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::OpenRFile ( TString  name,
std::ofstream &  f 
)
inlineprotected

Definition at line 237 of file RuleFitAPI.h.

Bool_t TMVA::RuleFitAPI::OpenRFile ( TString  name,
std::ifstream &  f 
)
inlineprotected

Definition at line 251 of file RuleFitAPI.h.

Int_t TMVA::RuleFitAPI::ReadFloat ( std::ifstream &  f,
Float_t v,
Int_t  n = 1 
) const
inlineprotected

Definition at line 290 of file RuleFitAPI.h.

Int_t TMVA::RuleFitAPI::ReadInt ( std::ifstream &  f,
Int_t v,
Int_t  n = 1 
) const
inlineprotected

Definition at line 281 of file RuleFitAPI.h.

Bool_t TMVA::RuleFitAPI::ReadIntParms ( )
protected
Bool_t TMVA::RuleFitAPI::ReadLx ( )
protected
Bool_t TMVA::RuleFitAPI::ReadModelSum ( )

read model from rulefit.sum

Definition at line 541 of file RuleFitAPI.cxx.

Referenced by TMVA::MethodRuleFit::TrainJFRuleFit().

Bool_t TMVA::RuleFitAPI::ReadProgram ( )
protected
Bool_t TMVA::RuleFitAPI::ReadRealParms ( )
protected
Bool_t TMVA::RuleFitAPI::ReadRealVarImp ( )
protected
Bool_t TMVA::RuleFitAPI::ReadRfOut ( )
protected
Bool_t TMVA::RuleFitAPI::ReadRfStatus ( )
protected
Bool_t TMVA::RuleFitAPI::ReadRuleFitMod ( )
protected
Bool_t TMVA::RuleFitAPI::ReadRuleFitSum ( )
protected
Bool_t TMVA::RuleFitAPI::ReadTrainW ( )
protected
Bool_t TMVA::RuleFitAPI::ReadTrainX ( )
protected
Bool_t TMVA::RuleFitAPI::ReadTrainY ( )
protected
Bool_t TMVA::RuleFitAPI::ReadVarImp ( )
protected

read variable importance

Definition at line 504 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::ReadVarNames ( )
protected
Bool_t TMVA::RuleFitAPI::ReadYhat ( )
protected

read the score

Definition at line 479 of file RuleFitAPI.cxx.

Int_t TMVA::RuleFitAPI::RunRuleFit ( )
protected

execute rf_go.exe

Definition at line 769 of file RuleFitAPI.cxx.

Referenced by TrainRuleFit().

void TMVA::RuleFitAPI::SetRFPredict ( )
inlineprotected

Definition at line 128 of file RuleFitAPI.h.

void TMVA::RuleFitAPI::SetRFTrain ( )
inlineprotected

Definition at line 127 of file RuleFitAPI.h.

void TMVA::RuleFitAPI::SetRFVarimp ( )
inlineprotected

Definition at line 129 of file RuleFitAPI.h.

void TMVA::RuleFitAPI::SetRFWorkDir ( const char *  wdir)

set the directory containing rf_go.exe.

Definition at line 152 of file RuleFitAPI.cxx.

void TMVA::RuleFitAPI::SetTestParms ( )
protected

set the test params

Definition at line 198 of file RuleFitAPI.cxx.

void TMVA::RuleFitAPI::SetTrainParms ( )
protected

set the training parameters

Definition at line 185 of file RuleFitAPI.cxx.

Referenced by TrainRuleFit().

void TMVA::RuleFitAPI::TestRuleFit ( )
inline

Definition at line 210 of file RuleFitAPI.h.

void TMVA::RuleFitAPI::TrainRuleFit ( )
inline

Definition at line 201 of file RuleFitAPI.h.

Referenced by TMVA::MethodRuleFit::TrainJFRuleFit().

void TMVA::RuleFitAPI::VarImp ( )
inline

Definition at line 220 of file RuleFitAPI.h.

void TMVA::RuleFitAPI::WelcomeMessage ( )

welcome message

Definition at line 73 of file RuleFitAPI.cxx.

Referenced by TMVA::MethodRuleFit::TrainJFRuleFit().

Bool_t TMVA::RuleFitAPI::WriteAll ( )
protected

write all files read by rf_go.exe

Definition at line 245 of file RuleFitAPI.cxx.

Referenced by TrainRuleFit().

Bool_t TMVA::RuleFitAPI::WriteFloat ( std::ofstream &  f,
const Float_t v,
Int_t  n = 1 
)
inlineprotected

Definition at line 273 of file RuleFitAPI.h.

Bool_t TMVA::RuleFitAPI::WriteInt ( std::ofstream &  f,
const Int_t v,
Int_t  n = 1 
)
inlineprotected

Definition at line 265 of file RuleFitAPI.h.

Bool_t TMVA::RuleFitAPI::WriteIntParms ( )
protected

write int params file

Definition at line 261 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteLx ( )
protected

Save input variable mask.

If the lx vector size is not the same as inputVars, resize it and fill it with 1 NOTE: Always set all to 1 if (fRFLx.size() != m_inputVars->size()) {

Definition at line 288 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteProgram ( )
protected

write command to rf_go.exe

Definition at line 302 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteRealParms ( )
protected

write int params file

Definition at line 272 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteRealVarImp ( )
protected

write the minimum importance to be considered

Definition at line 330 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteRfOut ( )
protected

written by rf_go.exe; write rulefit output (rfout)

Definition at line 344 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteRfStatus ( )
protected

written by rf_go.exe; write rulefit status

Definition at line 353 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteRuleFitMod ( )
protected

written by rf_go.exe (NOTE:Format unknown!)

Definition at line 362 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteRuleFitSum ( )
protected

written by rf_go.exe (NOTE: format unknown!)

Definition at line 371 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteTest ( )
protected

Write test data.

Definition at line 415 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteTrain ( )
protected

write training data, columnwise

Definition at line 380 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteVarImp ( )
protected

Definition at line 459 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteVarNames ( )
protected

write variable names, ascii

Definition at line 447 of file RuleFitAPI.cxx.

Bool_t TMVA::RuleFitAPI::WriteYhat ( )
protected

written by rf_go.exe

Definition at line 470 of file RuleFitAPI.cxx.

Member Data Documentation

MsgLogger TMVA::RuleFitAPI::fLogger
mutableprivate

Definition at line 192 of file RuleFitAPI.h.

const MethodRuleFit* TMVA::RuleFitAPI::fMethodRuleFit
private

Definition at line 179 of file RuleFitAPI.h.

TString TMVA::RuleFitAPI::fModelType
private

Definition at line 190 of file RuleFitAPI.h.

IntParms TMVA::RuleFitAPI::fRFIntParms
private

Definition at line 186 of file RuleFitAPI.h.

std::vector<int> TMVA::RuleFitAPI::fRFLx
private

Definition at line 188 of file RuleFitAPI.h.

ERFProgram TMVA::RuleFitAPI::fRFProgram
private

Definition at line 189 of file RuleFitAPI.h.

Referenced by SetRFPredict(), SetRFTrain(), and SetRFVarimp().

RealParms TMVA::RuleFitAPI::fRFRealParms
private

Definition at line 187 of file RuleFitAPI.h.

std::vector<Float_t> TMVA::RuleFitAPI::fRFVarImp
private

Definition at line 183 of file RuleFitAPI.h.

std::vector<Int_t> TMVA::RuleFitAPI::fRFVarImpInd
private

Definition at line 184 of file RuleFitAPI.h.

TString TMVA::RuleFitAPI::fRFWorkDir
private

Definition at line 185 of file RuleFitAPI.h.

Referenced by GetRFWorkDir().

std::vector<Float_t> TMVA::RuleFitAPI::fRFYhat
private

Definition at line 182 of file RuleFitAPI.h.

RuleFit* TMVA::RuleFitAPI::fRuleFit
private

Definition at line 180 of file RuleFitAPI.h.


The documentation for this class was generated from the following files: