svmfusvmtest.h

来自「Linux环境下的人脸识别程序」· C头文件 代码 · 共 67 行

H
67
字号
//     This is a part of the SvmFu library, a library for training//     Support Vector Machines.//     Copyright (C) 2000  rif and MIT////     Contact: rif@mit.edu//     This program is free software; you can redistribute it and/or//     modify it under the terms of the GNU General Public License as//     published by the Free Software Foundation; either version 2 of//     the License, or (at your option) any later version.//     This program is distributed in the hope that it will be useful,//     but WITHOUT ANY WARRANTY; without even the implied warranty of//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//     GNU General Public License for more details.//     You should have received a copy of the GNU General Public//     License along with this program; if not, write to the Free//     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,//     MA 02111-1307 USA#ifndef SVMFU_SVM_TEST_HEADER#define SVMFU_SVM_TEST_HEADER#include "SvmFuSvmConstants.h"#include "SvmFuSvmTypedefs.h"using namespace std;#include <math.h>#include <iostream>#include <fstream>#include <string>#include <stdio.h>//! This is a small, lightweight SVM class, for testing purposes.template <class DataPt, class KernVal> class SvmTest {public:    SvmTest(int svmSize,	  double *alphas,	  DataPt *trnSetPtr,	  double b,	  int *y,	  const KernVal (*kernProdFuncPtr) (const DataPt &pt1, 					    const DataPt &pt2));    virtual ~SvmTest();  int    classifyDataPt (const DataPt &pt) const;  double outputAtDataPt (const DataPt &pt) const;    double computeDataSetPerformance(int dataSetSize, DataPt *dataSet,				   int *y, bool printInfo=true) const;				     private:  int svmSize_;  double *alphas_;  DataPt *trnSetPtr_;  double b_;  IntVec y_;  const KernVal(*kernProdFuncPtr_)(const DataPt &pt1, const DataPt &pt2);};#endif // SVMFU_SVM_TEST_HEADER

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?