Skip to content

Commit

Permalink
[skip-ci] Fix TMVA tutorials typos (root-project#8460)
Browse files Browse the repository at this point in the history
- remove trailing spaces
- remove tabs
  • Loading branch information
couet authored and hristov committed Aug 27, 2021
1 parent 2a3b53e commit 7fb3834
Show file tree
Hide file tree
Showing 17 changed files with 117 additions and 117 deletions.
2 changes: 1 addition & 1 deletion tutorials/tmva/TMVAClassification.C
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ int TMVAClassification( TString myMethodList = "" )
// General layout.
TString layoutString ("Layout=TANH|128,TANH|128,TANH|128,LINEAR");

// Define Training strategy. One could define multiple stratgey string separated by the "|" delimiter
// Define Training strategy. One could define multiple strategy string separated by the "|" delimiter

TString trainingStrategyString = ("TrainingStrategy=LearningRate=1e-2,Momentum=0.9,"
"ConvergenceSteps=20,BatchSize=100,TestRepetitions=1,"
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tmva/TMVAClassificationApplication.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// within an analysis module
/// - Project : TMVA - a Root-integrated toolkit for multivariate data analysis
/// - Package : TMVA
/// - Exectuable: TMVAClassificationApplication
/// - Executable: TMVAClassificationApplication
///
/// \macro_output
/// \macro_code
Expand Down Expand Up @@ -315,7 +315,7 @@ void TMVAClassificationApplication( TString myMethodList = "" )
// Return the MVA outputs and fill into histograms

if (Use["CutsGA"]) {
// Cuts is a special case: give the desired signal efficienciy
// Cuts is a special case: give the desired signal efficiency
Bool_t passed = reader->EvaluateMVA( "CutsGA method", effS );
if (passed) nSelCutsGA++;
}
Expand Down Expand Up @@ -382,7 +382,7 @@ void TMVAClassificationApplication( TString myMethodList = "" )
if (Use["CutsGA"]) {

// test: retrieve cuts for particular signal efficiency
// CINT ignores dynamic_casts so we have to use a cuts-secific Reader function to acces the pointer
// CINT ignores dynamic_casts so we have to use a cuts-specific Reader function to acces the pointer
TMVA::MethodCuts* mcuts = reader->FindCutsMVA( "CutsGA method" ) ;

if (mcuts) {
Expand Down
4 changes: 2 additions & 2 deletions tutorials/tmva/TMVAClassificationCategoryApplication.C
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
/// (with categories) within an analysis module
/// - Project : TMVA - a Root-integrated toolkit for multivariate data analysis
/// - Package : TMVA
/// - Exectuable: TMVAClassificationCategoryApplication
/// - Executable: TMVAClassificationCategoryApplication
///
/// \macro_output
/// \macro_code
Expand Down Expand Up @@ -104,7 +104,7 @@ void TMVAClassificationCategoryApplication()
// but of course you can use different ones and copy the values inside the event loop
//
TTree* theTree = (TTree*)input->Get("TreeS");
std::cout << "--- Use signal sample for evalution" << std::endl;
std::cout << "--- Use signal sample for evaluation" << std::endl;
theTree->SetBranchAddress( "var1", &var1 );
theTree->SetBranchAddress( "var2", &var2 );
theTree->SetBranchAddress( "var3", &var3 );
Expand Down
12 changes: 6 additions & 6 deletions tutorials/tmva/TMVACrossValidation.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// This macro provides an example of how to use TMVA for k-folds cross
/// evaluation.
///
/// As input data is used a toy-MC sample consisting of two guassian
/// As input data is used a toy-MC sample consisting of two gaussian
/// distributions.
///
/// The output file "TMVA.root" can be analysed with the use of dedicated
Expand Down Expand Up @@ -174,7 +174,7 @@ int TMVACrossValidation(bool useRandomSplitting = false)
//
UInt_t numFolds = 2;
TString analysisType = "Classification";

TString splitType = (useRandomSplitting) ? "Random" : "Deterministic";

//
Expand All @@ -185,14 +185,14 @@ int TMVACrossValidation(bool useRandomSplitting = false)
// random and independent of the data, generated only once. This last
// property ensures that if a calibration is changed the same event will
// still be assigned the same fold.
//
//
// This can be used to use the cross validated classifiers in application,
// a technique that can simplify statistical analysis.
//
// If you want to run TMVACrossValidationApplication, make sure you have
//
// If you want to run TMVACrossValidationApplication, make sure you have
// run this tutorial with Deterministic splitting type, i.e.
// with the option useRandomSPlitting = false
//
//

TString splitExpr = (!useRandomSplitting) ? "int(fabs([eventID]))%int([NumFolds])" : "";

Expand Down
8 changes: 4 additions & 4 deletions tutorials/tmva/TMVACrossValidationApplication.C
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ int TMVACrossValidationApplication()
" splitExpr?" << std::endl;
exit(0);
}

}
{
TString methodName = "Fisher";
TString weightfile = TString("dataset/weights/") + jobname + "_" + methodName + TString(".weights.xml");

Bool_t weightfileExists = (gSystem->AccessPathName(weightfile) == kFALSE);
if (weightfileExists) {
reader->BookMVA(methodName, weightfile);
Expand Down Expand Up @@ -145,10 +145,10 @@ int TMVACrossValidationApplication()
c->Divide(2,1);
c->cd(1);
histBDTG.DrawClone();
c->cd(2);
c->cd(2);
histFisher.DrawClone();
}
else
else
{ // Write histograms to output file
TFile *target = new TFile("TMVACrossEvaluationApp.root", "RECREATE");
histBDTG.Write();
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tmva/TMVACrossValidationRegression.C
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/// This macro provides an example of how to use TMVA for k-folds cross
/// evaluation.
///
/// As input data is used a toy-MC sample consisting of two guassian
/// As input data is used a toy-MC sample consisting of two gaussian
/// distributions.
///
/// The output file "TMVA.root" can be analysed with the use of dedicated
Expand Down Expand Up @@ -108,7 +108,7 @@ int TMVACrossValidationRegression()
TFile * inputFile = getDataFile(infileName);

TMVA::DataLoader *dataloader=new TMVA::DataLoader("dataset");

dataloader->AddVariable("var1", "Variable 1", "units", 'F');
dataloader->AddVariable("var2", "Variable 2", "units", 'F');

Expand Down Expand Up @@ -142,7 +142,7 @@ int TMVACrossValidationRegression()
// This sets up a CrossValidation class (which wraps a TMVA::Factory
// internally) for 2-fold cross validation. The data will be split into the
// two folds randomly if `splitExpr` is `""`.
//
//
// One can also give a deterministic split using spectator variables. An
// example would be e.g. `"int(fabs([spec1]))%int([NumFolds])"`.
//
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tmva/TMVAGAexample.C
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// \file
/// \ingroup tutorial_tmva
/// \notebook -nodraw
/// This exectutable gives an example of a very simple use of the genetic algorithm
/// This executable gives an example of a very simple use of the genetic algorithm
/// of TMVA
/// - Project : TMVA - a Root-integrated toolkit for multivariate data analysis
/// - Package : TMVA
/// - Exectuable: TMVAGAexample
/// - Executable: TMVAGAexample
///
/// \macro_output
/// \macro_code
Expand Down Expand Up @@ -36,7 +36,7 @@ class MyFitness : public IFitterTarget {
// to (int). In this case the variable-range has to be chosen +1 ( to get 0..5, take Interval(0,6) )
// since the introduction of "Interval" ranges can be defined with a third parameter
// which gives the number of bins within the interval. With that technique discrete values
// can be achieved easier. The random selection out of this discrete numbers is completly uniform.
// can be achieved easier. The random selection out of this discrete numbers is completely uniform.
//
Double_t EstimatorFunction( std::vector<Double_t> & factors ){
//return (10.- (int)factors.at(0) *factors.at(1) + (int)factors.at(2));
Expand Down
6 changes: 3 additions & 3 deletions tutorials/tmva/TMVAGAexample2.C
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/// \file
/// \ingroup tutorial_tmva
/// \notebook -nodraw
/// This exectutable gives an example of a very simple use of the genetic algorithm
/// This executable gives an example of a very simple use of the genetic algorithm
/// of TMVA.
/// - Project : TMVA - a Root-integrated toolkit for multivariate data analysis
/// - Package : TMVA
/// - Exectuable: TMVAGAexample
/// - Executable: TMVAGAexample
///
/// \macro_output
/// \macro_code
Expand Down Expand Up @@ -38,7 +38,7 @@ class MyFitness : public IFitterTarget {
// to (int). In this case the variable-range has to be chosen +1 ( to get 0..5, take Interval(0,6) )
// since the introduction of "Interval" ranges can be defined with a third parameter
// which gives the number of bins within the interval. With that technique discrete values
// can be achieved easier. The random selection out of this discrete numbers is completly uniform.
// can be achieved easier. The random selection out of this discrete numbers is completely uniform.
//
Double_t EstimatorFunction( std::vector<Double_t> & factors ){
//return (10.- (int)factors.at(0) *factors.at(1) + (int)factors.at(2));
Expand Down
8 changes: 4 additions & 4 deletions tutorials/tmva/TMVAMinimalClassification.C
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
///
/// This is intended as a simple foundation to build on. It assumes you are
/// familiar with TMVA already. As such concepts like the Factory, the DataLoader
/// and others are not explained. For descriptions and tutuorials use the TMVA
/// and others are not explained. For descriptions and tutorials use the TMVA
/// User's Guide (https://root.cern.ch/root-user-guides-and-manuals under TMVA)
/// or the more detailed examples provided with TMVA e.g. TMVAClassification.C.
///
/// Sets up a minimal binary classification example with two slighly overlapping
/// Sets up a minimal binary classification example with two slightly overlapping
/// 2-D gaussian distributions and trains a BDT classifier to discriminate the
/// data.
///
Expand Down Expand Up @@ -63,7 +63,7 @@ TTree *genTree(Int_t nPoints, Double_t offset, Double_t scale, UInt_t seed = 100
}

//
// Minimal setup for perfroming binary classification in TMVA.
// Minimal setup for performing binary classification in TMVA.
//
// Modify the setup to your liking and run with
// `root -l -b -q TMVAMinimalClassification.C`.
Expand All @@ -75,7 +75,7 @@ void TMVAMinimalClassification()
TString outputFilename = "out.root";
TFile *outFile = new TFile(outputFilename, "RECREATE");

// Data generatration
// Data generation
TTree *signalTree = genTree(1000, 0.0, 2.0, 100);
TTree *backgroundTree = genTree(1000, 1.0, 2.0, 101);

Expand Down
2 changes: 1 addition & 1 deletion tutorials/tmva/TMVAMulticlassApplication.C
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void TMVAMulticlassApplication( TString myMethodList = "" )
// book output histograms
UInt_t nbin = 100;
TH1F *histMLP_signal(0), *histBDTG_signal(0), *histFDAGA_signal(0), *histPDEFoam_signal(0);
TH1F *histDLCPU_signal(0), *histDLGPU_signal(0);
TH1F *histDLCPU_signal(0), *histDLGPU_signal(0);
if (Use["MLP"])
histMLP_signal = new TH1F( "MVA_MLP_signal", "MVA_MLP_signal", nbin, 0., 1.1 );
if (Use["BDTG"])
Expand Down
Loading

0 comments on commit 7fb3834

Please sign in to comment.