ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TMVA::DataSet Class Reference

Definition at line 80 of file DataSet.h.

Public Member Functions

 DataSet (const DataSetInfo &)
 constructor More...
 
virtual ~DataSet ()
 destructor More...
 
void AddEvent (Event *, Types::ETreeType)
 add event to event list after which the event is owned by the dataset More...
 
Long64_t GetNEvents (Types::ETreeType type=Types::kMaxTreeType) const
 
Long64_t GetNTrainingEvents () const
 
Long64_t GetNTestEvents () const
 
const EventGetEvent () const
 
const EventGetEvent (Long64_t ievt) const
 
const EventGetTrainingEvent (Long64_t ievt) const
 
const EventGetTestEvent (Long64_t ievt) const
 
const EventGetEvent (Long64_t ievt, Types::ETreeType type) const
 
UInt_t GetNVariables () const
 access the number of variables through the datasetinfo More...
 
UInt_t GetNTargets () const
 access the number of targets through the datasetinfo More...
 
UInt_t GetNSpectators () const
 access the number of targets through the datasetinfo More...
 
void SetCurrentEvent (Long64_t ievt) const
 
void SetCurrentType (Types::ETreeType type) const
 
Types::ETreeType GetCurrentType () const
 
void SetEventCollection (std::vector< Event * > *, Types::ETreeType)
 Sets the event collection (by DataSetFactory) More...
 
const std::vector< Event * > & GetEventCollection (Types::ETreeType type=Types::kMaxTreeType) const
 
const TTreeGetEventCollectionAsTree ()
 
Long64_t GetNEvtSigTest ()
 return number of signal test events in dataset More...
 
Long64_t GetNEvtBkgdTest ()
 return number of background test events in dataset More...
 
Long64_t GetNEvtSigTrain ()
 return number of signal training events in dataset More...
 
Long64_t GetNEvtBkgdTrain ()
 return number of background training events in dataset More...
 
Bool_t HasNegativeEventWeights () const
 
ResultsGetResults (const TString &, Types::ETreeType type, Types::EAnalysisType analysistype)
 TString info(resultsName+"/"); switch(type) { case Types::kTraining: info += "kTraining/"; break; case Types::kTesting: info += "kTesting/"; break; default: break; } switch(analysistype) { case Types::kClassification: info += "kClassification"; break; case Types::kRegression: info += "kRegression"; break; case Types::kNoAnalysisType: info += "kNoAnalysisType"; break; case Types::kMaxAnalysisType:info += "kMaxAnalysisType"; break; }. More...
 
void DeleteResults (const TString &, Types::ETreeType type, Types::EAnalysisType analysistype)
 delete the results stored for this particulary Method instance (here appareantly called resultsName instead of MethodTitle Tree type (Training, testing etc..) Analysis Type (Classification, Multiclass, Regression etc..) More...
 
void SetVerbose (Bool_t)
 
void DivideTrainingSet (UInt_t blockNum)
 divide training set More...
 
void MoveTrainingBlock (Int_t blockInd, Types::ETreeType dest, Bool_t applyChanges=kTRUE)
 move training block More...
 
void IncrementNClassEvents (Int_t type, UInt_t classNumber)
 
Long64_t GetNClassEvents (Int_t type, UInt_t classNumber)
 
void ClearNClassEvents (Int_t type)
 
TTreeGetTree (Types::ETreeType type)
 create the test/trainings tree with all the variables, the weights, the classes, the targets, the spectators, the MVA outputs More...
 
void InitSampling (Float_t fraction, Float_t weight, UInt_t seed=0)
 initialize random or importance sampling More...
 
void EventResult (Bool_t successful, Long64_t evtNumber=-1)
 increase the importance sampling weight of the event when not successful and decrease it when successful More...
 
void CreateSampling () const
 create an event sampling (random or importance sampling) More...
 
UInt_t TreeIndex (Types::ETreeType type) const
 

Private Member Functions

 DataSet ()
 
void DestroyCollection (Types::ETreeType type, Bool_t deleteEvents)
 destroys the event collection (events + vector) More...
 
MsgLoggerLog () const
 
void ApplyTrainingBlockDivision ()
 
void ApplyTrainingSetDivision ()
 apply division of data set More...
 

Private Attributes

const DataSetInfofdsi
 
std::vector< Event * >::iterator fEvtCollIt
 datasetinfo that created this dataset More...
 
std::vector< std::vector
< Event * > * > 
fEventCollection
 
std::vector< std::map< TString,
Results * > > 
fResults
 list of events for training/testing/... More...
 
UInt_t fCurrentTreeIdx
 [train/test/...][method-identifier] More...
 
Long64_t fCurrentEventIdx
 
std::vector< Char_tfSampling
 
std::vector< Int_tfSamplingNEvents
 
std::vector< Float_tfSamplingWeight
 
std::vector< std::vector
< std::pair< Float_t, Long64_t > * > > 
fSamplingEventList
 
std::vector< std::vector
< std::pair< Float_t, Long64_t > * > > 
fSamplingSelected
 
TRandom3fSamplingRandom
 
std::vector< std::vector
< Long64_t > > 
fClassEvents
 
Bool_t fHasNegativeEventWeights
 number of events of class 0,1,2,... in training[0] More...
 
MsgLoggerfLogger
 
std::vector< Char_tfBlockBelongToTraining
 
Long64_t fTrainingBlockSize
 

#include <TMVA/DataSet.h>

Constructor & Destructor Documentation

TMVA::DataSet::DataSet ( const DataSetInfo dsi)

constructor

Definition at line 67 of file DataSet.cxx.

TMVA::DataSet::~DataSet ( )
virtual

destructor

Definition at line 100 of file DataSet.cxx.

TMVA::DataSet::DataSet ( )
private

Member Function Documentation

void TMVA::DataSet::AddEvent ( Event ev,
Types::ETreeType  type 
)

add event to event list after which the event is owned by the dataset

Definition at line 225 of file DataSet.cxx.

void TMVA::DataSet::ApplyTrainingBlockDivision ( )
private
void TMVA::DataSet::ApplyTrainingSetDivision ( )
private

apply division of data set

Definition at line 364 of file DataSet.cxx.

void TMVA::DataSet::ClearNClassEvents ( Int_t  type)

Definition at line 144 of file DataSet.cxx.

void TMVA::DataSet::CreateSampling ( ) const

create an event sampling (random or importance sampling)

Definition at line 478 of file DataSet.cxx.

void TMVA::DataSet::DeleteResults ( const TString resultsName,
Types::ETreeType  type,
Types::EAnalysisType  analysistype 
)

delete the results stored for this particulary Method instance (here appareantly called resultsName instead of MethodTitle Tree type (Training, testing etc..) Analysis Type (Classification, Multiclass, Regression etc..)

Definition at line 314 of file DataSet.cxx.

void TMVA::DataSet::DestroyCollection ( Types::ETreeType  type,
Bool_t  deleteEvents 
)
private

destroys the event collection (events + vector)

Definition at line 173 of file DataSet.cxx.

void TMVA::DataSet::DivideTrainingSet ( UInt_t  blockNum)

divide training set

Definition at line 340 of file DataSet.cxx.

void TMVA::DataSet::EventResult ( Bool_t  successful,
Long64_t  evtNumber = -1 
)

increase the importance sampling weight of the event when not successful and decrease it when successful

Definition at line 542 of file DataSet.cxx.

TMVA::Types::ETreeType TMVA::DataSet::GetCurrentType ( ) const
inline

Definition at line 213 of file DataSet.h.

const TMVA::Event * TMVA::DataSet::GetEvent ( ) const
const Event* TMVA::DataSet::GetEvent ( Long64_t  ievt) const
inline

Definition at line 95 of file DataSet.h.

Referenced by GetEvent().

const Event* TMVA::DataSet::GetEvent ( Long64_t  ievt,
Types::ETreeType  type 
) const
inline

Definition at line 98 of file DataSet.h.

const std::vector< TMVA::Event * > & TMVA::DataSet::GetEventCollection ( Types::ETreeType  type = Types::kMaxTreeType) const
inline

Definition at line 235 of file DataSet.h.

const TTree* TMVA::DataSet::GetEventCollectionAsTree ( )
Long64_t TMVA::DataSet::GetNClassEvents ( Int_t  type,
UInt_t  classNumber 
)

Definition at line 152 of file DataSet.cxx.

Referenced by TMVA::DataSetFactory::BuildInitialDataSet().

Long64_t TMVA::DataSet::GetNEvents ( Types::ETreeType  type = Types::kMaxTreeType) const
inline
Long64_t TMVA::DataSet::GetNEvtBkgdTest ( )

return number of background test events in dataset

Definition at line 404 of file DataSet.cxx.

Referenced by TMVA::Factory::EvaluateAllMethods().

Long64_t TMVA::DataSet::GetNEvtBkgdTrain ( )

return number of background training events in dataset

Definition at line 420 of file DataSet.cxx.

Referenced by TMVA::MethodRSVM::Train().

Long64_t TMVA::DataSet::GetNEvtSigTest ( )

return number of signal test events in dataset

Definition at line 396 of file DataSet.cxx.

Referenced by TMVA::Factory::EvaluateAllMethods().

Long64_t TMVA::DataSet::GetNEvtSigTrain ( )

return number of signal training events in dataset

Definition at line 412 of file DataSet.cxx.

Referenced by TMVA::MethodRSVM::Train().

UInt_t TMVA::DataSet::GetNSpectators ( ) const

access the number of targets through the datasetinfo

Definition at line 216 of file DataSet.cxx.

Referenced by TMVA::DataSetFactory::CalcMinMax().

UInt_t TMVA::DataSet::GetNTargets ( ) const

access the number of targets through the datasetinfo

Definition at line 208 of file DataSet.cxx.

Referenced by TMVA::DataSetFactory::CalcMinMax().

Long64_t TMVA::DataSet::GetNTestEvents ( ) const
inline

Definition at line 91 of file DataSet.h.

Referenced by TMVA::RMethodBase::LoadData(), and TMVA::DataSetFactory::MixEvents().

Long64_t TMVA::DataSet::GetNTrainingEvents ( ) const
inline
UInt_t TMVA::DataSet::GetNVariables ( ) const
TMVA::Results * TMVA::DataSet::GetResults ( const TString resultsName,
Types::ETreeType  type,
Types::EAnalysisType  analysistype 
)

TString info(resultsName+"/"); switch(type) { case Types::kTraining: info += "kTraining/"; break; case Types::kTesting: info += "kTesting/"; break; default: break; } switch(analysistype) { case Types::kClassification: info += "kClassification"; break; case Types::kRegression: info += "kRegression"; break; case Types::kNoAnalysisType: info += "kNoAnalysisType"; break; case Types::kMaxAnalysisType:info += "kMaxAnalysisType"; break; }.

Definition at line 263 of file DataSet.cxx.

Referenced by TMVA::Factory::EvaluateAllMethods().

const Event* TMVA::DataSet::GetTestEvent ( Long64_t  ievt) const
inline

Definition at line 97 of file DataSet.h.

const Event* TMVA::DataSet::GetTrainingEvent ( Long64_t  ievt) const
inline
TTree * TMVA::DataSet::GetTree ( Types::ETreeType  type)

create the test/trainings tree with all the variables, the weights, the classes, the targets, the spectators, the MVA outputs

Definition at line 579 of file DataSet.cxx.

Bool_t TMVA::DataSet::HasNegativeEventWeights ( ) const
inline

Definition at line 123 of file DataSet.h.

void TMVA::DataSet::IncrementNClassEvents ( Int_t  type,
UInt_t  classNumber 
)

Definition at line 135 of file DataSet.cxx.

void TMVA::DataSet::InitSampling ( Float_t  fraction,
Float_t  weight,
UInt_t  seed = 0 
)

initialize random or importance sampling

Definition at line 428 of file DataSet.cxx.

MsgLogger& TMVA::DataSet::Log ( ) const
inlineprivate

Definition at line 186 of file DataSet.h.

void TMVA::DataSet::MoveTrainingBlock ( Int_t  blockInd,
Types::ETreeType  dest,
Bool_t  applyChanges = kTRUE 
)

move training block

Definition at line 384 of file DataSet.cxx.

void TMVA::DataSet::SetCurrentEvent ( Long64_t  ievt) const
inline

Definition at line 110 of file DataSet.h.

Referenced by TMVA::DataSetFactory::BuildDynamicDataSet().

void TMVA::DataSet::SetCurrentType ( Types::ETreeType  type) const
inline
void TMVA::DataSet::SetEventCollection ( std::vector< Event * > *  events,
Types::ETreeType  type 
)

Sets the event collection (by DataSetFactory)

Definition at line 235 of file DataSet.cxx.

Referenced by TMVA::DataSetFactory::BuildDynamicDataSet(), and TMVA::DataSetFactory::MixEvents().

void TMVA::DataSet::SetVerbose ( Bool_t  )
inline

Definition at line 132 of file DataSet.h.

UInt_t TMVA::DataSet::TreeIndex ( Types::ETreeType  type) const
inline

Definition at line 200 of file DataSet.h.

Referenced by GetEvent(), and SetCurrentType().

Member Data Documentation

std::vector<Char_t> TMVA::DataSet::fBlockBelongToTraining
private

Definition at line 187 of file DataSet.h.

Referenced by DataSet().

std::vector< std::vector<Long64_t> > TMVA::DataSet::fClassEvents
private

Definition at line 180 of file DataSet.h.

Referenced by DataSet().

Long64_t TMVA::DataSet::fCurrentEventIdx
mutableprivate

Definition at line 168 of file DataSet.h.

Referenced by GetEvent(), and SetCurrentEvent().

UInt_t TMVA::DataSet::fCurrentTreeIdx
mutableprivate

[train/test/...][method-identifier]

Definition at line 167 of file DataSet.h.

Referenced by GetEvent(), SetCurrentType(), and TreeIndex().

const DataSetInfo& TMVA::DataSet::fdsi
private

Definition at line 160 of file DataSet.h.

std::vector< std::vector<Event*>* > TMVA::DataSet::fEventCollection
private

Definition at line 163 of file DataSet.h.

std::vector<Event*>::iterator TMVA::DataSet::fEvtCollIt
private

datasetinfo that created this dataset

Definition at line 162 of file DataSet.h.

Bool_t TMVA::DataSet::fHasNegativeEventWeights
private

number of events of class 0,1,2,... in training[0]

Definition at line 183 of file DataSet.h.

Referenced by HasNegativeEventWeights().

MsgLogger* TMVA::DataSet::fLogger
mutableprivate

Definition at line 185 of file DataSet.h.

Referenced by Log().

std::vector< std::map< TString, Results* > > TMVA::DataSet::fResults
private

list of events for training/testing/...

Definition at line 165 of file DataSet.h.

std::vector<Char_t> TMVA::DataSet::fSampling
private

Definition at line 171 of file DataSet.h.

Referenced by DataSet().

std::vector< std::vector< std::pair< Float_t, Long64_t >* > > TMVA::DataSet::fSamplingEventList
mutableprivate

Definition at line 174 of file DataSet.h.

std::vector<Int_t> TMVA::DataSet::fSamplingNEvents
private

Definition at line 172 of file DataSet.h.

Referenced by DataSet().

TRandom3* TMVA::DataSet::fSamplingRandom
private

Definition at line 176 of file DataSet.h.

Referenced by DataSet().

std::vector< std::vector< std::pair< Float_t, Long64_t >* > > TMVA::DataSet::fSamplingSelected
mutableprivate

Definition at line 175 of file DataSet.h.

std::vector<Float_t> TMVA::DataSet::fSamplingWeight
private

Definition at line 173 of file DataSet.h.

Referenced by DataSet().

Long64_t TMVA::DataSet::fTrainingBlockSize
private

Definition at line 191 of file DataSet.h.

Collaboration diagram for TMVA::DataSet:
[legend]

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