Logo ROOT  
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#include "RtypesCore.h"
34
35namespace TMVA {
36
37 class SVEvent;
38 class SVKernelMatrix;
39 class SVKernelFunction;
40 class MsgLogger;
41
43
44 public:
45
47 SVWorkingSet( std::vector<TMVA::SVEvent*>*, SVKernelFunction*, Float_t , Bool_t);
49
53 void Train(UInt_t nIter=1000);
54 std::vector<TMVA::SVEvent*>* GetSupportVectors();
55 Float_t GetBpar() {return 0.5*(fB_low + fB_up);}
56
57 //for regression
61 void TrainReg();
62
63 //setting up helper variables for JsMVA
64 void SetIPythonInteractive(bool* ExitFromTraining, UInt_t *fIPyCurrentIter_){
65 fExitFromTraining = ExitFromTraining;
66 fIPyCurrentIter = fIPyCurrentIter_;
67 }
68
69
70 private:
71
72 Bool_t fdoRegression; ///< TODO temporary, find nicer solution
73 std::vector<TMVA::SVEvent*> *fInputData; ///< input events
74 std::vector<TMVA::SVEvent*> *fSupVec; ///< output events - support vectors
75 SVKernelFunction *fKFunction; ///< kernel function
76 SVKernelMatrix *fKMatrix; ///< kernel matrix
77
78 SVEvent *fTEventUp; ///< last optimized event
79 SVEvent *fTEventLow; ///< last optimized event
80
81 Float_t fB_low; ///< documentation
82 Float_t fB_up; ///< documentation
83 Float_t fTolerance; ///< documentation
84
85 mutable MsgLogger* fLogger; ///<! message logger
86
87 // variables for JsMVA
89 bool * fExitFromTraining = nullptr;
90
91 void SetIndex( TMVA::SVEvent* );
92 };
93}
94
95#endif //ROOT_TMVA_SVWorkingSet
bool Bool_t
Definition: RtypesCore.h:63
float Float_t
Definition: RtypesCore.h:57
ostringstream derivative to redirect and format output
Definition: MsgLogger.h:57
Event class for Support Vector Machine.
Definition: SVEvent.h:40
Kernel for Support Vector Machine.
Kernel matrix for Support Vector Machine.
Working class for Support Vector Machine.
Definition: SVWorkingSet.h:42
SVEvent * fTEventUp
last optimized event
Definition: SVWorkingSet.h:78
Bool_t TakeStep(SVEvent *, SVEvent *)
std::vector< TMVA::SVEvent * > * fSupVec
output events - support vectors
Definition: SVWorkingSet.h:74
void Train(UInt_t nIter=1000)
train the SVM
bool * fExitFromTraining
Definition: SVWorkingSet.h:89
Bool_t IsDiffSignificant(Float_t, Float_t, Float_t)
Float_t fTolerance
documentation
Definition: SVWorkingSet.h:83
Bool_t ExamineExample(SVEvent *)
Bool_t ExamineExampleReg(SVEvent *)
Bool_t fdoRegression
TODO temporary, find nicer solution.
Definition: SVWorkingSet.h:72
Bool_t TakeStepReg(SVEvent *, SVEvent *)
Float_t fB_low
documentation
Definition: SVWorkingSet.h:81
Float_t fB_up
documentation
Definition: SVWorkingSet.h:82
SVEvent * fTEventLow
last optimized event
Definition: SVWorkingSet.h:79
void SetIndex(TMVA::SVEvent *)
~SVWorkingSet()
destructor
UInt_t * fIPyCurrentIter
Definition: SVWorkingSet.h:88
SVWorkingSet()
constructor
std::vector< TMVA::SVEvent * > * fInputData
input events
Definition: SVWorkingSet.h:73
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyCurrentIter_)
Definition: SVWorkingSet.h:64
MsgLogger * fLogger
! message logger
Definition: SVWorkingSet.h:85
SVKernelFunction * fKFunction
kernel function
Definition: SVWorkingSet.h:75
SVKernelMatrix * fKMatrix
kernel matrix
Definition: SVWorkingSet.h:76
std::vector< TMVA::SVEvent * > * GetSupportVectors()
create variable transformations