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