46 #ifndef ROOT_TMVA_PDEFoamTarget
55 TMVA::PDEFoamTarget::PDEFoamTarget()
81 , fTarget(from.fTarget)
83 Log() <<
kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
94 std::vector<Float_t> values = ev->
GetValues();
95 std::vector<Float_t> tvalues = VarTransform(values);
96 std::vector<Float_t> targets = ev->
GetTargets();
101 SetCellElement(cell, 0, GetCellElement(cell, 0) + wt);
102 SetCellElement(cell, 1, GetCellElement(cell, 1) + wt * targets.at(fTarget));
113 for (
Long_t iCell = 0; iCell <= fLastCe; iCell++) {
114 if (!(fCells[iCell]->GetStat()))
117 Double_t n_ev = GetCellElement(fCells[iCell], 0);
118 Double_t tar = GetCellElement(fCells[iCell], 1);
121 SetCellElement(fCells[iCell], 0, tar / n_ev);
122 SetCellElement(fCells[iCell], 1, tar /
TMath::Sqrt(n_ev));
124 SetCellElement(fCells[iCell], 0, 0.0);
125 SetCellElement(fCells[iCell], 1, -1);
150 std::vector<Float_t> txvec(VarTransform(xvec));
153 if (!CellValueIsUndefined(cell)) {
156 return GetCellValue(cell, cv);
158 return kernel->
Estimate(
this, txvec, cv);
161 return GetAverageNeighborsValue(txvec,
kValue);
183 cell->
GetHcub(cellPosi, cellSize);
186 for (
Int_t dim = 0; dim < GetTotDim(); dim++) {
187 std::vector<Float_t> ntxvec(txvec);
192 ntxvec[dim] = cellPosi[dim] - xoffset;
193 left_cell = FindCell(ntxvec);
194 if (!CellValueIsUndefined(left_cell)) {
196 result += GetCellValue(left_cell, cv);
200 ntxvec[dim] = cellPosi[dim] + cellSize[dim] + xoffset;
201 right_cell = FindCell(ntxvec);
202 if (!CellValueIsUndefined(right_cell)) {
204 result += GetCellValue(right_cell, cv);
208 if (norm > 0) result /=
norm;
MsgLogger & Endl(MsgLogger &ml)
ClassImp(TMVA::PDEFoamTarget) TMVA
Default constructor for streamer, user should not use it.
Bool_t CellValueIsUndefined(PDEFoamCell *cell)
Returns true, if the target error equals -1, as set in Finalize() in case of no events in the cell...
virtual void FillFoamCells(const Event *ev, Float_t wt)
This function fills an event into the discriminant PDEFoam.
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)=0
Float_t GetAverageNeighborsValue(std::vector< Float_t > &, ECellValue)
This function returns the average value 'cv' of only nearest neighbor cells.
std::vector< Float_t > & GetTargets()
virtual void Finalize()
Calculate average cell target in every cell and save them to the cell.
Abstract ClassifierFactory template that handles arbitrary types.
std::vector< Float_t > & GetValues()
Double_t Sqrt(Double_t x)
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
double norm(double *x, double *p)
virtual Float_t GetCellValue(const std::vector< Float_t > &xvec, ECellValue cv, PDEFoamKernelBase *)
This function finds the cell, which corresponds to the given untransformed event vector 'xvec' and re...