00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2006 Mikio L. Braun 00008 * Written (W) 1999-2008 Soeren Sonnenburg 00009 * Copyright (C) 1999-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00010 */ 00011 00012 #ifndef _KRR_H__ 00013 #define _KRR_H__ 00014 00015 #include "lib/config.h" 00016 #include "regression/Regression.h" 00017 00018 #ifdef HAVE_LAPACK 00019 00020 #include "kernel/KernelMachine.h" 00021 00050 class CKRR : public CKernelMachine 00051 { 00052 public: 00054 CKRR(); 00055 00062 CKRR(float64_t tau, CKernel* k, CLabels* lab); 00063 virtual ~CKRR(); 00064 00069 inline void set_tau(float64_t t) { tau = t; }; 00070 00075 virtual bool train(); 00076 00082 virtual CLabels* classify(CLabels* output=NULL); 00083 00089 virtual float64_t classify_example(int32_t num); 00090 00096 virtual bool load(FILE* srcfile); 00097 00103 virtual bool save(FILE* dstfile); 00104 00109 inline virtual EClassifierType get_classifier_type() 00110 { 00111 return CT_KRR; 00112 } 00113 00114 private: 00116 float64_t *alpha; 00118 float64_t tau; 00119 }; 00120 00121 #endif /* HAVE_LAPACK */ 00122 00123 #endif