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 00017 #ifdef HAVE_LAPACK 00018 00019 #include "kernel/KernelMachine.h" 00020 00022 class CKRR : public CKernelMachine 00023 { 00024 public: 00026 CKRR(); 00027 00034 CKRR(DREAL tau, CKernel* k, CLabels* lab); 00035 virtual ~CKRR(); 00036 00041 inline void set_tau(DREAL t) { tau = t; }; 00042 00047 virtual bool train(); 00048 00054 virtual CLabels* classify(CLabels* output=NULL); 00055 00061 virtual DREAL classify_example(INT num); 00062 00068 virtual bool load(FILE* srcfile); 00069 00075 virtual bool save(FILE* dstfile); 00076 00081 inline virtual EClassifierType get_classifier_type() 00082 { 00083 return CT_KRR; 00084 } 00085 00086 private: 00088 DREAL *alpha; 00090 DREAL tau; 00091 }; 00092 00093 #endif /* HAVE_LAPACK */ 00094 00095 #endif