26 #ifndef ROOT_TMVA_ModulekNN
27 #define ROOT_TMVA_ModulekNN
51 #ifndef ROOT_ThreadLocalStorage
54 #ifndef ROOT_TMVA_NodekNN
94 void Print(std::ostream& os)
const;
106 typedef std::pair<const Node<Event> *, VarType>
Elem;
115 typedef std::map<int, std::vector<Double_t> >
VarMap;
138 const std::map<Int_t, Double_t>&
GetMetric()
const;
141 void Print(std::ostream &os)
const;
180 const VarType var2 =
GetVar(ivar);
181 return (var1 - var2) * (var1 - var2);
Event()
default constructor
const std::map< Int_t, Double_t > & GetMetric() const
Random number generator class based on M.
ModulekNN()
default constructor
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...
VarType GetTgt(UInt_t i) const
std::ostream & operator<<(std::ostream &os, const Event &event)
streamer
std::map< int, std::vector< Double_t > > VarMap
std::map< Int_t, Double_t > fVarScale
std::vector< TMVA::kNN::Event > EventVec
const VarVec & GetTargets() const
void SetTargets(const VarVec &tvec)
Bool_t Fill(const UShort_t odepth, UInt_t ifrac, const std::string &option="")
fill the tree
const VarVec & GetVars() const
const EventVec & GetEventVec() const
void Add(const Event &event)
add an event to tree
const VarMap & GetVarMap() const
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...
Double_t GetWeight() const
const List & GetkNNList() const
std::pair< const Node< Event > *, VarType > Elem
VarType GetDist(VarType var, UInt_t ivar) const
static TRandom3 & GetRndmThreadLocal()
Abstract ClassifierFactory template that handles arbitrary types.
VarType GetVar(UInt_t i) const
std::map< Short_t, UInt_t > fCount
Node< Event > * Optimize(UInt_t optimize_depth)
Optimize() balances binary tree for first odepth levels for each depth we split sorted depth % dimens...
const Event & GetkNNEvent() const
std::vector< VarType > VarVec
void ComputeMetric(UInt_t ifrac)
compute scale factor for each variable (dimension) so that distance is computed uniformely along each...