ROOT  6.06/09
Reference Guide
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
TMVA::kNN::ModulekNN Class Reference

Definition at line 111 of file ModulekNN.h.

Public Types

typedef std::map< int, std::vector< Double_t > > VarMap
 

Public Member Functions

 ModulekNN ()
 default constructor More...
 
 ~ModulekNN ()
 destructor More...
 
void Clear ()
 clean up More...
 
void Add (const Event &event)
 add an event to tree More...
 
Bool_t Fill (const UShort_t odepth, UInt_t ifrac, const std::string &option="")
 fill the tree More...
 
Bool_t Find (Event event, UInt_t nfind=100, const std::string &option="count") const
 find in tree if tree has been filled then search for nfind closest events if metic (fVarScale map) is computed then rescale event variables using previsouly computed width of variable distribution More...
 
Bool_t Find (UInt_t nfind, const std::string &option) const
 find in tree More...
 
const EventVecGetEventVec () const
 
const ListGetkNNList () const
 
const EventGetkNNEvent () const
 
const VarMapGetVarMap () const
 
const std::map< Int_t, Double_t > & GetMetric () const
 
void Print () const
 print More...
 
void Print (std::ostream &os) const
 print More...
 

Private Member Functions

Node< Event > * Optimize (UInt_t optimize_depth)
 Optimize() balances binary tree for first odepth levels for each depth we split sorted depth % dimension variables into 2^odepth parts. More...
 
void ComputeMetric (UInt_t ifrac)
 compute scale factor for each variable (dimension) so that distance is computed uniformely along each dimension compute width of interval that includes (100 - 2*ifrac)% of events below, assume that in fVar each vector of values is sorted More...
 
const Event Scale (const Event &event) const
 scale each event variable so that rms of variables is approximately 1.0 this allows comparisons of variables with distinct scales and units More...
 
MsgLoggerLog () const
 

Static Private Member Functions

static TRandom3GetRndmThreadLocal ()
 

Private Attributes

UInt_t fDimn
 
Node< Event > * fTree
 
std::map< Int_t, Double_tfVarScale
 
List fkNNList
 
Event fkNNEvent
 
std::map< Short_t, UInt_tfCount
 
EventVec fEvent
 
VarMap fVar
 
MsgLoggerfLogger
 

#include <TMVA/ModulekNN.h>

+ Collaboration diagram for TMVA::kNN::ModulekNN:

Member Typedef Documentation

typedef std::map<int, std::vector<Double_t> > TMVA::kNN::ModulekNN::VarMap

Definition at line 115 of file ModulekNN.h.

Constructor & Destructor Documentation

TMVA::kNN::ModulekNN::ModulekNN ( )

default constructor

Definition at line 166 of file ModulekNN.cxx.

TMVA::kNN::ModulekNN::~ModulekNN ( )

destructor

Definition at line 176 of file ModulekNN.cxx.

Member Function Documentation

void TMVA::kNN::ModulekNN::Add ( const Event event)

add an event to tree

Definition at line 205 of file ModulekNN.cxx.

void TMVA::kNN::ModulekNN::Clear ( )

clean up

Definition at line 187 of file ModulekNN.cxx.

void TMVA::kNN::ModulekNN::ComputeMetric ( UInt_t  ifrac)
private

compute scale factor for each variable (dimension) so that distance is computed uniformely along each dimension compute width of interval that includes (100 - 2*ifrac)% of events below, assume that in fVar each vector of values is sorted

Definition at line 535 of file ModulekNN.cxx.

Bool_t TMVA::kNN::ModulekNN::Fill ( const UShort_t  odepth,
UInt_t  ifrac,
const std::string &  option = "" 
)

fill the tree

Definition at line 238 of file ModulekNN.cxx.

Bool_t TMVA::kNN::ModulekNN::Find ( Event  event,
UInt_t  nfind = 100,
const std::string &  option = "count" 
) const

find in tree if tree has been filled then search for nfind closest events if metic (fVarScale map) is computed then rescale event variables using previsouly computed width of variable distribution

Definition at line 341 of file ModulekNN.cxx.

Bool_t TMVA::kNN::ModulekNN::Find ( UInt_t  nfind,
const std::string &  option 
) const

find in tree

Definition at line 386 of file ModulekNN.cxx.

const EventVec & TMVA::kNN::ModulekNN::GetEventVec ( ) const
inline

Definition at line 220 of file ModulekNN.h.

const Event & TMVA::kNN::ModulekNN::GetkNNEvent ( ) const
inline

Definition at line 216 of file ModulekNN.h.

const List & TMVA::kNN::ModulekNN::GetkNNList ( ) const
inline

Definition at line 212 of file ModulekNN.h.

const std::map< Int_t, Double_t > & TMVA::kNN::ModulekNN::GetMetric ( ) const
inline

Definition at line 228 of file ModulekNN.h.

static TRandom3& TMVA::kNN::ModulekNN::GetRndmThreadLocal ( )
inlinestaticprivate

Definition at line 155 of file ModulekNN.h.

const ModulekNN::VarMap & TMVA::kNN::ModulekNN::GetVarMap ( ) const
inline

Definition at line 224 of file ModulekNN.h.

MsgLogger& TMVA::kNN::ModulekNN::Log ( ) const
inlineprivate

Definition at line 172 of file ModulekNN.h.

TMVA::kNN::Node< TMVA::kNN::Event > * TMVA::kNN::ModulekNN::Optimize ( UInt_t  optimize_depth)
private

Optimize() balances binary tree for first odepth levels for each depth we split sorted depth % dimension variables into 2^odepth parts.

Definition at line 442 of file ModulekNN.cxx.

void TMVA::kNN::ModulekNN::Print ( ) const

print

Definition at line 655 of file ModulekNN.cxx.

void TMVA::kNN::ModulekNN::Print ( std::ostream &  os) const

print

Definition at line 663 of file ModulekNN.cxx.

const TMVA::kNN::Event TMVA::kNN::ModulekNN::Scale ( const Event event) const
private

scale each event variable so that rms of variables is approximately 1.0 this allows comparisons of variables with distinct scales and units

Definition at line 621 of file ModulekNN.cxx.

Member Data Documentation

std::map<Short_t, UInt_t> TMVA::kNN::ModulekNN::fCount
private

Definition at line 166 of file ModulekNN.h.

UInt_t TMVA::kNN::ModulekNN::fDimn
private

Definition at line 155 of file ModulekNN.h.

EventVec TMVA::kNN::ModulekNN::fEvent
private

Definition at line 168 of file ModulekNN.h.

Referenced by GetEventVec().

Event TMVA::kNN::ModulekNN::fkNNEvent
mutableprivate

Definition at line 164 of file ModulekNN.h.

Referenced by GetkNNEvent().

List TMVA::kNN::ModulekNN::fkNNList
mutableprivate

Definition at line 163 of file ModulekNN.h.

Referenced by GetkNNList().

MsgLogger* TMVA::kNN::ModulekNN::fLogger
mutableprivate

Definition at line 171 of file ModulekNN.h.

Referenced by Log().

Node<Event>* TMVA::kNN::ModulekNN::fTree
private

Definition at line 159 of file ModulekNN.h.

VarMap TMVA::kNN::ModulekNN::fVar
private

Definition at line 169 of file ModulekNN.h.

Referenced by GetVarMap().

std::map<Int_t, Double_t> TMVA::kNN::ModulekNN::fVarScale
private

Definition at line 161 of file ModulekNN.h.

Referenced by GetMetric().


The documentation for this class was generated from the following files: