13 using namespace TMVA::Experimental;
15 void tmva004_RStandardScaler()
18 ROOT::RDataFrame df(
"TreeS",
"http://root.cern/files/tmva_class_example.root");
19 auto x = AsTensor<float>(df);
22 RStandardScaler<float> scaler;
26 auto y = scaler.Compute(x);
29 TH1F h1(
"h1",
";x_{4};N_{Events}", 20, -4, 4);
30 TH1F h2(
"h2",
";x_{4};N_{Events}", 20, -4, 4);
31 for (std::size_t i = 0; i < x.GetShape()[0]; i++) {
36 h1.SetLineColor(kRed);
38 h2.SetLineColor(kBlue);
40 gStyle->SetOptStat(0);
41 auto c =
new TCanvas(
"",
"", 800, 800);
45 TLegend legend(0.7, 0.7, 0.89, 0.89);
46 legend.SetBorderSize(0);
47 legend.AddEntry(
"h1",
"Unscaled",
"l");
48 legend.AddEntry(
"h2",
"Scaled",
"l");