Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 * *
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 * (see tmva/doc/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.
SVEvent * fTEventUp
last optimized event
Bool_t TakeStep(SVEvent *, SVEvent *)
std::vector< TMVA::SVEvent * > * fSupVec
output events - support vectors
void Train(UInt_t nIter=1000)
train the SVM
Bool_t IsDiffSignificant(Float_t, Float_t, Float_t)
Float_t fTolerance
documentation
Bool_t ExamineExample(SVEvent *)
Bool_t ExamineExampleReg(SVEvent *)
Bool_t fdoRegression
TODO temporary, find nicer solution.
Bool_t TakeStepReg(SVEvent *, SVEvent *)
Float_t fB_low
documentation
Float_t fB_up
documentation
SVEvent * fTEventLow
last optimized event
void SetIndex(TMVA::SVEvent *)
~SVWorkingSet()
destructor
UInt_t * fIPyCurrentIter
SVWorkingSet()
constructor
std::vector< TMVA::SVEvent * > * fInputData
input events
void SetIPythonInteractive(bool *ExitFromTraining, UInt_t *fIPyCurrentIter_)
MsgLogger * fLogger
! message logger
SVKernelFunction * fKFunction
kernel function
SVKernelMatrix * fKMatrix
kernel matrix
std::vector< TMVA::SVEvent * > * GetSupportVectors()
create variable transformations