Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TMVA::kNN::Node< T > Class Template Reference

template<class T>
class TMVA::kNN::Node< T >

This file contains binary tree and global function template that searches tree for k-nearest neigbors.

Node class template parameter T has to provide these functions: rtype GetVar(UInt_t) const;

  • rtype is any type convertible to Float_t UInt_t GetNVar(void) const; rtype GetWeight(void) const;
  • rtype is any type convertible to Double_t

Find function template parameter T has to provide these functions: (in addition to above requirements) rtype GetDist(Float_t, UInt_t) const;

  • rtype is any type convertible to Float_t rtype GetDist(const T &) const;
  • rtype is any type convertible to Float_t

where T::GetDist(Float_t, UInt_t) <= T::GetDist(const T &) for any pair of events and any variable number for these events

Definition at line 67 of file NodekNN.h.

Public Member Functions

 Node (const Node *parent, const T &event, Int_t mod)
 
 ~Node ()
 
const NodeAdd (const T &event, UInt_t depth)
 This is Node member function that adds a new node to a binary tree.
 
const T & GetEvent () const
 
UInt_t GetMod () const
 
const NodeGetNodeL () const
 
const NodeGetNodeP () const
 
const NodeGetNodeR () const
 
Float_t GetVarDis () const
 
Float_t GetVarMax () const
 
Float_t GetVarMin () const
 
Double_t GetWeight () const
 
void Print () const
 
void Print (std::ostream &os, const std::string &offset="") const
 
void SetNodeL (Node *node)
 
void SetNodeR (Node *node)
 

Private Member Functions

 Node ()
 
 Node (const Node &)
 
const Nodeoperator= (const Node &)
 

Private Attributes

const T fEvent
 
const UInt_t fMod
 
NodefNodeL
 
const NodefNodeP
 
NodefNodeR
 
const Float_t fVarDis
 
Float_t fVarMax
 
Float_t fVarMin
 

#include <TMVA/NodekNN.h>

Constructor & Destructor Documentation

◆ Node() [1/3]

template<class T >
TMVA::kNN::Node< T >::Node ( const Node< T > *  parent,
const T &  event,
Int_t  mod 
)

Definition at line 225 of file NodekNN.h.

◆ ~Node()

template<class T >
TMVA::kNN::Node< T >::~Node

Definition at line 238 of file NodekNN.h.

◆ Node() [2/3]

template<class T >
TMVA::kNN::Node< T >::Node ( )
private

◆ Node() [3/3]

template<class T >
TMVA::kNN::Node< T >::Node ( const Node< T > &  )
private

Member Function Documentation

◆ Add()

template<class T >
const TMVA::kNN::Node< T > * TMVA::kNN::Node< T >::Add ( const T &  event,
UInt_t  depth 
)

This is Node member function that adds a new node to a binary tree.

each node contains maximum and minimum values of splitting variable left or right nodes are added based on value of splitting variable

Definition at line 250 of file NodekNN.h.

◆ GetEvent()

template<class T >
const T & TMVA::kNN::Node< T >::GetEvent
inline

Definition at line 157 of file NodekNN.h.

◆ GetMod()

template<class T >
UInt_t TMVA::kNN::Node< T >::GetMod
inline

Definition at line 205 of file NodekNN.h.

◆ GetNodeL()

template<class T >
const Node< T > * TMVA::kNN::Node< T >::GetNodeL
inline

Definition at line 163 of file NodekNN.h.

◆ GetNodeP()

template<class T >
const Node< T > * TMVA::kNN::Node< T >::GetNodeP
inline

Definition at line 175 of file NodekNN.h.

◆ GetNodeR()

template<class T >
const Node< T > * TMVA::kNN::Node< T >::GetNodeR
inline

Definition at line 169 of file NodekNN.h.

◆ GetVarDis()

template<class T >
Float_t TMVA::kNN::Node< T >::GetVarDis
inline

Definition at line 187 of file NodekNN.h.

◆ GetVarMax()

template<class T >
Float_t TMVA::kNN::Node< T >::GetVarMax
inline

Definition at line 199 of file NodekNN.h.

◆ GetVarMin()

template<class T >
Float_t TMVA::kNN::Node< T >::GetVarMin
inline

Definition at line 193 of file NodekNN.h.

◆ GetWeight()

template<class T >
Double_t TMVA::kNN::Node< T >::GetWeight ( void  ) const
inline

Definition at line 181 of file NodekNN.h.

◆ operator=()

template<class T >
const Node & TMVA::kNN::Node< T >::operator= ( const Node< T > &  )
private

◆ Print() [1/2]

template<class T >
void TMVA::kNN::Node< T >::Print

Definition at line 286 of file NodekNN.h.

◆ Print() [2/2]

template<class T >
void TMVA::kNN::Node< T >::Print ( std::ostream &  os,
const std::string &  offset = "" 
) const

Definition at line 293 of file NodekNN.h.

◆ SetNodeL()

template<class T >
void TMVA::kNN::Node< T >::SetNodeL ( Node< T > *  node)
inline

Definition at line 145 of file NodekNN.h.

◆ SetNodeR()

template<class T >
void TMVA::kNN::Node< T >::SetNodeR ( Node< T > *  node)
inline

Definition at line 151 of file NodekNN.h.

Member Data Documentation

◆ fEvent

template<class T >
const T TMVA::kNN::Node< T >::fEvent
private

Definition at line 112 of file NodekNN.h.

◆ fMod

template<class T >
const UInt_t TMVA::kNN::Node< T >::fMod
private

Definition at line 119 of file NodekNN.h.

◆ fNodeL

template<class T >
Node* TMVA::kNN::Node< T >::fNodeL
private

Definition at line 109 of file NodekNN.h.

◆ fNodeP

template<class T >
const Node* TMVA::kNN::Node< T >::fNodeP
private

Definition at line 107 of file NodekNN.h.

◆ fNodeR

template<class T >
Node* TMVA::kNN::Node< T >::fNodeR
private

Definition at line 110 of file NodekNN.h.

◆ fVarDis

template<class T >
const Float_t TMVA::kNN::Node< T >::fVarDis
private

Definition at line 114 of file NodekNN.h.

◆ fVarMax

template<class T >
Float_t TMVA::kNN::Node< T >::fVarMax
private

Definition at line 117 of file NodekNN.h.

◆ fVarMin

template<class T >
Float_t TMVA::kNN::Node< T >::fVarMin
private

Definition at line 116 of file NodekNN.h.

  • tmva/tmva/inc/TMVA/NodekNN.h