ROOT  6.06/09
Reference Guide
SVWorkingSet.h
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Andrzej Zemla
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Class : SVWorkingSet *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Working class for Support Vector Machine *
12  * *
13  * Authors (alphabetical): *
14  * Marcin Wolter <Marcin.Wolter@cern.ch> - IFJ PAN, Krakow, Poland *
15  * Andrzej Zemla <azemla@cern.ch> - IFJ PAN, Krakow, Poland *
16  * (IFJ PAN: Henryk Niewodniczanski Inst. Nucl. Physics, Krakow, Poland) *
17  * *
18  * Copyright (c) 2005: *
19  * CERN, Switzerland *
20  * MPI-K Heidelberg, Germany *
21  * PAN, Krakow, Poland *
22  * *
23  * Redistribution and use in source and binary forms, with or without *
24  * modification, are permitted according to the terms listed in LICENSE *
25  * (http://tmva.sourceforge.net/LICENSE) *
26  **********************************************************************************/
27 
28 #ifndef ROOT_TMVA_SVWorkingSet
29 #define ROOT_TMVA_SVWorkingSet
30 
31 #include <vector>
32 
33 #ifndef ROOT_Rtypes
34 #include "Rtypes.h"
35 #endif
36 
37 namespace TMVA {
38 
39  class SVEvent;
40  class SVKernelMatrix;
41  class SVKernelFunction;
42  class MsgLogger;
43 
44  class SVWorkingSet {
45 
46  public:
47 
48  SVWorkingSet();
49  SVWorkingSet( std::vector<TMVA::SVEvent*>*, SVKernelFunction*, Float_t , Bool_t);
50  ~SVWorkingSet();
51 
55  void Train(UInt_t nIter=1000);
56  void PrintStat();
57  std::vector<TMVA::SVEvent*>* GetSupportVectors();
58  Float_t GetBpar() {return 0.5*(fB_low + fB_up);}
59 
60  //for regression
64  void TrainReg();
65 
66 
67  private:
68 
69  Bool_t fdoRegression; //TODO temporary, find nicer solution
70  std::vector<TMVA::SVEvent*> *fInputData; // input events
71  std::vector<TMVA::SVEvent*> *fSupVec; // output events - support vectors
72  SVKernelFunction *fKFunction; // kernel function
73  SVKernelMatrix *fKMatrix; // kernel matrix
74 
75  SVEvent *fTEventUp; // last optimized event
76  SVEvent *fTEventLow; // last optimized event
77 
78  Float_t fB_low; // documentation
79  Float_t fB_up; // documentation
80  Float_t fTolerance; // documentation
81 
82  mutable MsgLogger* fLogger; //! message logger
83 
84  void SetIndex( TMVA::SVEvent* );
85  };
86 }
87 
88 #endif //ROOT_TMVA_SVWorkingSet
~SVWorkingSet()
destructor
float Float_t
Definition: RtypesCore.h:53
SVWorkingSet()
constructor
std::vector< TMVA::SVEvent * > * fSupVec
Definition: SVWorkingSet.h:71
void SetIndex(TMVA::SVEvent *)
message logger
void Train(UInt_t nIter=1000)
train the SVM
Bool_t TakeStep(SVEvent *, SVEvent *)
bool Bool_t
Definition: RtypesCore.h:59
MsgLogger * fLogger
Definition: SVWorkingSet.h:82
SVKernelFunction * fKFunction
Definition: SVWorkingSet.h:72
Bool_t ExamineExampleReg(SVEvent *)
unsigned int UInt_t
Definition: RtypesCore.h:42
Bool_t ExamineExample(SVEvent *)
Bool_t TakeStepReg(SVEvent *, SVEvent *)
std::vector< TMVA::SVEvent * > * GetSupportVectors()
Abstract ClassifierFactory template that handles arbitrary types.
SVKernelMatrix * fKMatrix
Definition: SVWorkingSet.h:73
Bool_t IsDiffSignificant(Float_t, Float_t, Float_t)
std::vector< TMVA::SVEvent * > * fInputData
Definition: SVWorkingSet.h:70
SVEvent * fTEventUp
Definition: SVWorkingSet.h:75
SVEvent * fTEventLow
Definition: SVWorkingSet.h:76