2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
7BDT::GetResponse() const
9 return (!m_pointers.empty() ? GetResponse(m_pointers) : -9999.);
13BDT::GetClassification() const
15 return (!m_pointers.empty() ? GetClassification(m_pointers) : -9999.);
18inline std::vector<float>
19BDT::GetMultiResponse(unsigned int numClasses) const
21 return (!m_pointers.empty() ? GetMultiResponse(m_pointers, numClasses)
22 : std::vector<float>());
25inline std::vector<float>
28 std::vector<float> result;
29 for (float* ptr : m_pointers) {
31 result.push_back(*ptr);
36inline const std::vector<float*>&
37BDT::GetPointers() const
42BDT::SetPointers(const std::vector<float*>& pointers)
44 m_pointers = pointers;
49 return m_forest->GetNTrees();
54 return m_forest->GetNVars();
59 return m_forest->GetOffset();
62/** Return offset + the sum of the response of each tree **/
64BDT::GetResponse(const std::vector<float>& values) const
66 return m_forest->GetResponse(values);
69/** Return offset + the sum of the response of each tree **/
71BDT::GetResponse(const std::vector<float*>& pointers) const
73 return m_forest->GetResponse(pointers);
77BDT::GetClassification(const std::vector<float>& values) const
79 return m_forest->GetClassification(values);
83BDT::GetClassification(const std::vector<float*>& pointers) const
85 return m_forest->GetClassification(pointers);
89BDT::GetGradBoostMVA(const std::vector<float>& values) const
91 const float sum = m_forest->GetRawResponse(values); // ignores the offset
92 return 2. / (1 + std::exp(-2 * sum)) -
93 1; // output shaping for gradient boosted decision tree (-1,1)
97BDT::GetGradBoostMVA(const std::vector<float*>& pointers) const
99 const float sum = m_forest->GetRawResponse(pointers); // ignores the offset
100 // output shaping for gradient boosted decision tree (-1,1)
101 return 2. / (1 + std::exp(-2 * sum)) - 1;
104inline std::vector<float>
105BDT::GetMultiResponse(const std::vector<float>& values,
106 unsigned int numClasses) const
108 return m_forest->GetMultiResponse(values, numClasses);
111inline std::vector<float>
112BDT::GetMultiResponse(const std::vector<float*>& pointers,
113 unsigned int numClasses) const
115 return m_forest->GetMultiResponse(pointers, numClasses);
119BDT::GetTreeResponse(const std::vector<float>& values,
120 MVAUtils::index_t index) const
122 return m_forest->GetTreeResponse(values, index);
126BDT::GetTreeResponse(const std::vector<float*>& pointers,
127 MVAUtils::index_t index) const
129 return m_forest->GetTreeResponse(pointers, index);