ROOT
master
Reference Guide
Loading...
Searching...
No Matches
RFunction_Mean.cxx
Go to the documentation of this file.
1
#include "
TMVA/RFunction_Mean.hxx
"
2
3
4
namespace
TMVA
{
5
namespace
Experimental {
6
namespace
SOFIE {
7
8
std::string
RFunction_Mean::GenerateModel
() {
9
std::string modelGenerationString;
10
modelGenerationString =
"\n//--------- GNN_Aggregate_Function---"
+
fFuncName
+
"\n"
;
11
modelGenerationString +=
"std::vector<float> "
+
fFuncName
+
"(const int& num_features, const std::vector<std::vector<float>::iterator>& inputs){\n"
;
12
modelGenerationString +=
"\tstd::vector<float> result(num_features,0);\n"
;
13
modelGenerationString +=
"\tfor(auto &it:inputs){\n"
;
14
modelGenerationString +=
"\t\tstd::transform(result.begin(), result.end(), it, result.begin(), std::plus<float>());\n\t}\n"
;
15
modelGenerationString +=
"\tfor_each(result.begin(), result.end(), [&result](float &x){ x /= result.size();\n"
;
16
modelGenerationString +=
"\treturn result;\n}"
;
17
return
modelGenerationString;
18
}
19
20
}
21
}
22
}
RFunction_Mean.hxx
TMVA::Experimental::SOFIE::RFunction_Mean::GenerateModel
std::string GenerateModel()
Definition
RFunction_Mean.cxx:8
TMVA::Experimental::SOFIE::RFunction::fFuncName
std::string fFuncName
Definition
RFunction.hxx:19
TMVA
create variable transformations
Definition
GeneticMinimizer.h:22
tmva
sofie
src
RFunction_Mean.cxx
ROOT master - Reference Guide Generated on Sat Nov 16 2024 09:39:03 (GVA Time) using Doxygen 1.9.8