* *
**********************************************************************************/
#include "TMVA/MethodRuleFit.h"
#include "TMVA/Tools.h"
#include "TMatrix.h"
#include "Riostream.h"
#include <algorithm>
ClassImp(TMVA::MethodRuleFit)
TMVA::MethodRuleFit::MethodRuleFit( TString jobName, vector<TString>* theVariables,
TTree* theTree, TString theOption, TDirectory* theTargetDir )
: TMVA::MethodBase( jobName, theVariables, theTree, theOption, theTargetDir )
{
InitRuleFit();
}
TMVA::MethodRuleFit::MethodRuleFit( vector<TString> *theVariables,
TString theWeightFile,
TDirectory* theTargetDir )
: TMVA::MethodBase( theVariables, theWeightFile, theTargetDir )
{
InitRuleFit();
}
void TMVA::MethodRuleFit::InitRuleFit( void )
{
fMethodName = "RuleFit";
fMethod = TMVA::Types::RuleFit;
fTestvar = fTestvarPrefix+GetMethodName();
}
TMVA::MethodRuleFit::~MethodRuleFit( void )
{
}
void TMVA::MethodRuleFit::Train( void )
{
if (!CheckSanity()) {
cout << "--- " << GetName() << ": Error: sanity check failed" << endl;
exit(1);
}
WriteWeightsToFile();
}
void TMVA::MethodRuleFit::WriteWeightsToFile( void )
{
TString fname = GetWeightFileName();
cout << "--- " << GetName() << ": creating weight file: " << fname << endl;
ofstream fout( fname );
if (!fout.good( )) {
cout << "--- " << GetName() << ": Error in ::WriteWeightsToFile: "
<< "unable to open output weight file: " << fname << endl;
exit(1);
}
fout.close();
}
void TMVA::MethodRuleFit::ReadWeightsFromFile( void )
{
TString fname = GetWeightFileName();
cout << "--- " << GetName() << ": reading weight file: " << fname << endl;
ifstream fin( fname );
if (!fin.good( )) {
cout << "--- " << GetName() << ": Error in ::ReadWeightsFromFile: "
<< "unable to open input file: " << fname << endl;
exit(1);
}
fin.close();
}
Double_t TMVA::MethodRuleFit::GetMvaValue( TMVA::Event * )
{
Double_t myMVA = 0;
return myMVA;
}
void TMVA::MethodRuleFit::WriteHistosToFile( void )
{
cout << "--- " << GetName() << ": write " << GetName()
<<" special histos to file: " << fBaseDir->GetPath() << endl;
}
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.