82 fDataSetManager (
NULL ),
84 fTransformations (
"I" ),
86 fDataAssignType ( kAssignEvents ),
100 std::vector<TMVA::VariableTransformBase*>::iterator
trfIt = fDefaultTrfs.
begin();
103 delete fDataInputHandler;
107 delete fDataSetManager;
121 return fDataSetManager->AddDataSetInfo(
dsi);
139 return DefaultDataSetInfo();
171 Log() << kFATAL <<
" VT transformation must be passed a floating threshold value" <<
Endl;
183 Log() << kFATAL <<
"Incorrect transformation string provided, please check" <<
Endl;
185 Log() << kINFO <<
"No transformation applied, returning original loader" <<
Endl;
199 assignTree->Branch(
"type", &fATreeType,
"ATreeType/I" );
200 assignTree->Branch(
"weight", &fATreeWeight,
"ATreeWeight/F" );
202 std::vector<VariableInfo>& vars = DefaultDataSetInfo().GetVariableInfos();
203 std::vector<VariableInfo>&
tgts = DefaultDataSetInfo().GetTargetInfos();
204 std::vector<VariableInfo>&
spec = DefaultDataSetInfo().GetSpectatorInfos();
206 if (fATreeEvent.size()==0) fATreeEvent.resize(vars.size()+
tgts.size()+
spec.size());
278 const std::vector<Double_t>& event,
Double_t weight )
289 if (
clIndex>=fTrainAssignTree.size()) {
290 fTrainAssignTree.resize(
clIndex+1, 0);
291 fTestAssignTree.resize(
clIndex+1, 0);
294 if (fTrainAssignTree[
clIndex]==0) {
300 fATreeWeight = weight;
304 else fTestAssignTree[
clIndex]->Fill();
313 return fTrainAssignTree[
clIndex]!=0;
323 if(!UserAssignEvents(i))
continue;
324 const TString& className = DefaultDataSetInfo().GetClassInfo(i)->GetName();
325 SetWeightExpression(
"weight", className );
343 Log() << kFATAL <<
"<AddTree> cannot interpret tree type: \"" <<
treetype
344 <<
"\" should be \"Training\" or \"Test\" or \"Training and Testing\"" <<
Endl;
346 AddTree( tree, className, weight, cut,
tt );
355 Log() << kFATAL <<
"Tree does not exist (empty pointer)." <<
Endl;
357 DefaultDataSetInfo().AddClass( className );
363 Log() << kINFO<<
"Add Tree " << tree->GetName() <<
" of type " << className
364 <<
" with " << tree->GetEntries() <<
" events" <<
Endl;
365 DataInput().AddTree( tree, className, weight, cut,
tt );
385 Log() << kINFO <<
"Create TTree objects from ASCII input files ... \n- Signal file : \""
416 Log() << kINFO <<
"Create TTree objects from ASCII input files ... \n- Background file : \""
434 AddTree( tree,
"Signal", weight );
441 AddTree( tree,
"Background", weight );
488 DefaultDataSetInfo().AddVariable( expression, title, unit, min, max,
type );
497 DefaultDataSetInfo().AddVariable( expression,
"",
"", min, max,
type );
507 DefaultDataSetInfo().AddVariablesArray(expression,
size,
"",
"", min, max,
type);
518 DefaultDataSetInfo().AddTarget( expression, title, unit, min, max );
527 DefaultDataSetInfo().AddSpectator( expression, title, unit, min, max );
535 return AddDataSet( fName );
551 DefaultDataSetInfo().SetWeightExpression(variable,
"Signal");
558 DefaultDataSetInfo().SetWeightExpression(variable,
"Background");
567 SetSignalWeightExpression(variable);
568 SetBackgroundWeightExpression(variable);
570 else DefaultDataSetInfo().SetWeightExpression( variable, className );
576 SetCut(
TCut(cut), className );
583 DefaultDataSetInfo().SetCut( cut, className );
590 AddCut(
TCut(cut), className );
596 DefaultDataSetInfo().AddCut( cut, className );
606 SetInputTreesFromEventAssignTrees();
610 DefaultDataSetInfo().SetSplitOptions(
TString::Format(
"nTrain_Signal=%i:nTrain_Background=%i:nTest_Signal=%i:nTest_Background=%i:%s",
620 SetInputTreesFromEventAssignTrees();
624 DefaultDataSetInfo().SetSplitOptions(
TString::Format(
"nTrain_Signal=%i:nTrain_Background=%i:nTest_Signal=%i:nTest_Background=%i:SplitMode=Random:EqualTrainSample:!V",
634 SetInputTreesFromEventAssignTrees();
636 DefaultDataSetInfo().PrintClasses();
638 DefaultDataSetInfo().SetSplitOptions( opt );
647 SetInputTreesFromEventAssignTrees();
650 AddCut(
sigcut,
"Signal" );
651 AddCut(
bkgcut,
"Background" );
653 DefaultDataSetInfo().SetSplitOptions(
splitOpt );
705 des->AddSignalTree( (*treeinfo).GetTree(), (*treeinfo).GetWeight(),(*treeinfo).GetTreeType());
710 des->AddBackgroundTree( (*treeinfo).GetTree(), (*treeinfo).GetWeight(),(*treeinfo).GetTreeType());
719 const TMatrixD *
m = DefaultDataSetInfo().CorrelationMatrix(className);
720 return DefaultDataSetInfo().CreateCorrelationMatrixHist(
m,
721 "CorrelationMatrix"+className,
"Correlation Matrix ("+className+
")");
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
const_iterator begin() const
const_iterator end() const
A specialized string object used for TTree selections.
Service class for 2-D histogram classes.
Class that contains all the information of a class.
MsgLogger * fLogger
! message logger
virtual void RecombineKFoldDataSet(DataSetInfo &dsi, Types::ETreeType tt=Types::kTraining)
virtual void MakeKFoldDataSet(DataSetInfo &dsi)=0
virtual void PrepareFoldDataSet(DataSetInfo &dsi, UInt_t foldNumber, Types::ETreeType tt)
Set training and test set vectors of dataset described by dsi.
DataInputHandler * fDataInputHandler
->
TTree * CreateEventAssignTrees(const TString &name)
create the data assignment tree (for event-wise data assignment by user)
void AddVariablesArray(const TString &expression, int size, char type='F', Double_t min=0, Double_t max=0)
user inserts discriminating array of variables in data set info in case input tree provides an array ...
void SetBackgroundTree(TTree *background, Double_t weight=1.0)
void AddSignalTree(TTree *signal, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
DataSetInfo & AddDataSet(DataSetInfo &)
void AddSpectator(const TString &expression, const TString &title="", const TString &unit="", Double_t min=0, Double_t max=0)
user inserts target in data set info
void SetInputTreesFromEventAssignTrees()
assign event-wise local trees to data set
void AddTrainingEvent(const TString &className, const std::vector< Double_t > &event, Double_t weight)
add signal training event
void SetTree(TTree *tree, const TString &className, Double_t weight)
deprecated
void AddSignalTestEvent(const std::vector< Double_t > &event, Double_t weight=1.0)
add signal testing event
DataSetInfo & DefaultDataSetInfo()
default creation
void AddBackgroundTestEvent(const std::vector< Double_t > &event, Double_t weight=1.0)
add signal training event
DataSetManager * fDataSetManager
DataLoader * MakeCopy(TString name)
Copy method use in VI and CV.
void SetSignalWeightExpression(const TString &variable)
void MakeKFoldDataSet(CvSplit &s)
Function required to split the training and testing datasets into a number of folds.
void SetWeightExpression(const TString &variable, const TString &className="")
void AddBackgroundTrainingEvent(const std::vector< Double_t > &event, Double_t weight=1.0)
add signal training event
void RecombineKFoldDataSet(CvSplit &s, Types::ETreeType tt=Types::kTraining)
Recombines the dataset.
DataLoader * VarTransform(TString trafoDefinition)
Transforms the variables and return a new DataLoader with the transformed variables.
void SetBackgroundWeightExpression(const TString &variable)
void AddCut(const TString &cut, const TString &className="")
void AddEvent(const TString &className, Types::ETreeType tt, const std::vector< Double_t > &event, Double_t weight)
add event vector event : the order of values is: variables + targets + spectators
DataLoader(TString thedlName="default")
void PrepareTrainingAndTestTree(const TCut &cut, const TString &splitOpt)
prepare the training and test trees -> same cuts for signal and background
void AddBackgroundTree(TTree *background, Double_t weight=1.0, Types::ETreeType treetype=Types::kMaxTreeType)
number of signal events (used to compute significance)
DataSetInfo & GetDataSetInfo()
void AddTarget(const TString &expression, const TString &title="", const TString &unit="", Double_t min=0, Double_t max=0)
user inserts target in data set info
TH2 * GetCorrelationMatrix(const TString &className)
returns the correlation matrix of datasets
Bool_t UserAssignEvents(UInt_t clIndex)
void AddSignalTrainingEvent(const std::vector< Double_t > &event, Double_t weight=1.0)
add signal training event
void AddTestEvent(const TString &className, const std::vector< Double_t > &event, Double_t weight)
add signal test event
void SetSignalTree(TTree *signal, Double_t weight=1.0)
void SetInputTrees(const TString &signalFileName, const TString &backgroundFileName, Double_t signalWeight=1.0, Double_t backgroundWeight=1.0)
void AddTree(TTree *tree, const TString &className, Double_t weight=1.0, const TCut &cut="", Types::ETreeType tt=Types::kMaxTreeType)
void SetInputVariables(std::vector< TString > *theVariables)
deprecated
void SetCut(const TString &cut, const TString &className="")
void AddVariable(const TString &expression, const TString &title, const TString &unit, char type='F', Double_t min=0, Double_t max=0)
user inserts discriminating variable in data set info
void PrepareFoldDataSet(CvSplit &s, UInt_t foldNumber, Types::ETreeType tt=Types::kTraining)
Function for assigning the correct folds to the testing or training set.
Class that contains all the data information.
Class that contains all the data information.
void SetSource(const std::string &source)
@ kMaxTreeType
also used as temporary storage for trees not yet assigned for testing;training...
virtual void SetName(const char *name)
Set the name of the TNamed.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
A TTree represents a columnar dataset.
void DataLoaderCopy(TMVA::DataLoader *des, TMVA::DataLoader *src)
MsgLogger & Endl(MsgLogger &ml)