26#ifndef ROOT_TMVA_ModulekNN
27#define ROOT_TMVA_ModulekNN
86 void Print(std::ostream& os)
const;
97 typedef std::vector<TMVA::kNN::Event>
EventVec;
99 typedef std::list<Elem>
List;
107 typedef std::map<int, std::vector<Double_t> >
VarMap;
130 const std::map<Int_t, Double_t>&
GetMetric()
const;
133 void Print(std::ostream &os)
const;
172 const VarType var2 =
GetVar(ivar);
173 return (var1 - var2) * (var1 - var2);
TBuffer & operator<<(TBuffer &buf, const Tmpl *obj)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
ostringstream derivative to redirect and format output
VarType GetDist(VarType var, UInt_t ivar) const
VarType GetTgt(UInt_t i) const
void SetTargets(const VarVec &tvec)
VarVec fVar
coordinates (variables) for knn search
const VarVec & GetTargets() const
Double_t GetWeight() const
Event()
default constructor
VarVec fTgt
targets for regression analysis
VarType GetVar(UInt_t i) const
const VarVec & GetVars() const
std::map< Int_t, Double_t > fVarScale
Bool_t Fill(const UShort_t odepth, UInt_t ifrac, const std::string &option="")
fill the tree
const VarMap & GetVarMap() const
Node< Event > * Optimize(UInt_t optimize_depth)
Optimize() balances binary tree for first odepth levels for each depth we split sorted depth % dimens...
const EventVec & GetEventVec() const
static TRandom3 & GetRndmThreadLocal()
std::map< int, std::vector< Double_t > > VarMap
ModulekNN()
default constructor
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...
const Event Scale(const Event &event) const
scale each event variable so that rms of variables is approximately 1.0 this allows comparisons of va...
void ComputeMetric(UInt_t ifrac)
compute scale factor for each variable (dimension) so that distance is computed uniformly along each ...
const Event & GetkNNEvent() const
const std::map< Int_t, Double_t > & GetMetric() const
std::map< Short_t, UInt_t > fCount
void Add(const Event &event)
add an event to tree
const List & GetkNNList() const
This file contains binary tree and global function template that searches tree for k-nearest neigbors...
kNN::Event describes point in input variable vector-space, with additional functionality like distanc...
std::vector< TMVA::kNN::Event > EventVec
std::vector< VarType > VarVec
std::pair< const Node< Event > *, VarType > Elem
Random number generator class based on M.
create variable transformations