Machine Learning Library
CSVMModel.h
Go to the documentation of this file.
1 #ifndef CSVMModel_H
2 #define CSVMModel_H
3 
4 #include "CObject.h"
5 #include "CSVCandidate.h"
6 #include "CVector.h"
7 #include "CDenseVector.h"
8 #include "CKernel.h"
9 #include "CArchiv.h"
10 
11 template<class Type>
12 class CSVMModel : public CObject<Type>{
13 protected:
14  vector< CSVCandidate<Type> > m_tSVs;
17  Type m_tBias;
21 public:
22  CSVMModel();
23  CSVMModel(const vector<CSVCandidate<Type> >& rtSVs, const CKernel<Type>& rtKernel, Type tBias, Type tSigmoidA=0, Type tSigmoidB=0);
24  CSVMModel(const CSVMModel<Type>& rtModel);
25  ~CSVMModel();
26  CSVMModel<Type>& operator=(const CSVMModel<Type>& rtModel);
27  bool serialize2(CArchiv& tAr);
28  int classify(const CVector<Type>& rtPattern) const;
29  void classify(const CVector<Type>& rtPattern, Type& rtClass, Type& rtMargin) const;
30  string className() const { return "CSVMModel";};
31  bool isA(const char* acClass) const { if(string(acClass) == this->className()) return true; else return CObject<Type>::isA(acClass);};
32 };
33 
34 #endif
Definition: CSVMModel.h:12
Type m_tSigmoidB
Definition: CSVMModel.h:19
CKernel< Type > * m_ptKernel
Definition: CSVMModel.h:15
vector< CSVCandidate< Type > > m_tSVs
Definition: CSVMModel.h:14
string className() const
Returns the class name.
Definition: CSVMModel.h:30
Type m_tSigmoidA
Definition: CSVMModel.h:18
bool isA(const char *acClass) const
Check if the object is an instance of the class with given name.
Definition: CSVMModel.h:31
CSVMModel< Type > & operator=(const CSVMModel< Type > &rtModel)
int classify(const CVector< Type > &rtPattern) const
Definition: CSVCandidate.h:59
Base class of object serialization.
Definition: CArchiv.h:19
Base class for kernel functions Base class for kernel function used for example by the support vector...
Definition: CKernel.h:46
Template object for vectors of single and double precision and integer.
Definition: CDenseVector.h:37
templatized vector for numerical applications
Definition: CMatrix.h:39
Base class for all object.
Definition: CObject.h:51
bool m_bCalibrated
Definition: CSVMModel.h:20
Type m_tBias
Definition: CSVMModel.h:17
virtual bool isA(const char *acClass) const
Check if the object is an instance of the class with given name.
Definition: CObject.h:93
CDenseVector< Type > m_tWeight
Definition: CSVMModel.h:16
bool serialize2(CArchiv &tAr)