38 #ifndef ROOT_TMVA_MethodPDERS
39 #define ROOT_TMVA_MethodPDERS
59 class MethodPDERS :
public MethodBase {
63 MethodPDERS(
const TString& jobName,
64 const TString& methodTitle,
66 const TString& theOption);
68 MethodPDERS( DataSetInfo& theData,
69 const TString& theWeightFile);
71 virtual ~MethodPDERS(
void );
73 virtual Bool_t HasAnalysisType( Types::EAnalysisType type, UInt_t numberClasses, UInt_t numberTargets );
80 void WriteWeightsToStream( TFile& rf )
const;
81 void AddWeightsXMLTo(
void* parent )
const;
84 void ReadWeightsFromStream( std::istream& istr );
85 void ReadWeightsFromStream( TFile& istr );
86 void ReadWeightsFromXML(
void* wghtnode );
89 Double_t GetMvaValue( Double_t* err = 0, Double_t* errUpper = 0 );
92 const std::vector<Float_t>& GetRegressionValues();
96 static Double_t IGetVolumeContentForRoot( Double_t );
97 Double_t GetVolumeContentForRoot( Double_t );
100 static MethodPDERS* ThisPDERS(
void );
105 void MakeClassSpecific( std::ostream&,
const TString& )
const;
108 void GetHelpMessage()
const;
114 BinarySearchTree* GetBinaryTree(
void )
const {
return fBinaryTree; }
116 Double_t CKernelEstimate(
const Event&, std::vector<const BinarySearchTreeNode*>&, Volume& );
117 void RKernelEstimate(
const Event&, std::vector<const BinarySearchTreeNode*>&, Volume&, std::vector<Float_t> *pdfSum );
119 Double_t ApplyKernelFunction( Double_t normalized_distance );
120 Double_t KernelNormalization( Double_t pdf );
121 Double_t GetNormalizedDistance(
const TMVA::Event &base_event,
122 const BinarySearchTreeNode &sample_event,
123 Double_t *dim_normalization);
124 Double_t NormSinc( Double_t x );
125 Double_t LanczosFilter( Int_t level, Double_t x );
128 const Ranking* CreateRanking() {
return 0; }
133 void DeclareOptions();
134 void ProcessOptions();
140 void CreateBinarySearchTree( Types::ETreeType type );
143 void GetSample(
const Event &e, std::vector<const BinarySearchTreeNode*>& events, Volume *volume);
146 TString fVolumeRange;
147 TString fKernelString;
149 enum EVolumeRangeMode {
158 enum EKernelEstimator {
175 BinarySearchTree* fBinaryTree;
177 std::vector<Float_t>* fDelta;
178 std::vector<Float_t>* fShift;
179 std::vector<Float_t> fAverageRMS;
184 Double_t fGaussSigma;
185 Double_t fGaussSigmaNorm;
192 Float_t fMaxVIterations;
193 Float_t fInitialScale;
195 Bool_t fInitializedVolumeEle;
200 Double_t fMax_distance;
204 void SetVolumeElement (
void );
206 Double_t CRScalc (
const Event& );
207 void RRScalc (
const Event&, std::vector<Float_t>* count );
209 Float_t GetError ( Float_t countS, Float_t countB,
210 Float_t sumW2S, Float_t sumW2B )
const;
214 static MethodPDERS*& GetMethodPDERSThreadLocal() {TTHREAD_TLS(MethodPDERS*) fgThisPDERS(
nullptr); return fgThisPDERS;};
219 ClassDef(MethodPDERS,0);
224 #endif // MethodPDERS_H