2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
6 template<typename Node_t>
8 ForestWeighted<Node_t>::GetTreeResponseWeighted(
9 const std::vector<float>& values,
10 unsigned int itree) const
12 return Forest<Node_t>::GetTreeResponse(values, itree) * m_weights[itree];
14 template<typename Node_t>
16 ForestWeighted<Node_t>::GetTreeResponseWeighted(
17 const std::vector<float*>& pointers,
18 unsigned int itree) const
20 return Forest<Node_t>::GetTreeResponse(pointers, itree) * m_weights[itree];
23 template<typename Node_t>
25 ForestWeighted<Node_t>::GetWeightedResponse(
26 const std::vector<float>& values) const
29 for (unsigned int itree = 0; itree != GetNTrees(); ++itree) {
30 result += GetTreeResponseWeighted(values, itree);
35 template<typename Node_t>
37 ForestWeighted<Node_t>::GetWeightedResponse(
38 const std::vector<float*>& pointers) const
41 for (unsigned int itree = 0; itree != GetNTrees(); ++itree) {
42 result += GetTreeResponseWeighted(pointers, itree);
47 template<typename Node_t>
49 ForestWeighted<Node_t>::newTree(const std::vector<Node_t>& nodes, float weight)
52 m_weights.push_back(weight);
53 m_sumWeights += weight;
57 ForestTMVA::GetResponse(const std::vector<float>& values) const
59 return GetRawResponse(values) + GetOffset();
63 ForestTMVA::GetResponse(const std::vector<float*>& pointers) const
65 return GetRawResponse(pointers) + GetOffset();
69 ForestTMVA::GetClassification(const std::vector<float>& values) const
71 float result = GetWeightedResponse(values);
72 return result / GetSumWeights();
76 ForestTMVA::GetClassification(const std::vector<float*>& pointers) const
78 float result = GetWeightedResponse(pointers);
79 return result / GetSumWeights();