LinearRidgeRegression.h

Go to the documentation of this file.
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  * Copyright (C) 2012 Soeren Sonnenburg
00008  */
00009 
00010 #ifndef _LINEARRIDGEREGRESSION_H__
00011 #define _LINEARRIDGEREGRESSION_H__
00012 
00013 #include <shogun/lib/config.h>
00014 
00015 #ifdef HAVE_LAPACK
00016 
00017 #include <shogun/regression/Regression.h>
00018 #include <shogun/machine/LinearMachine.h>
00019 #include <shogun/features/DenseFeatures.h>
00020 
00021 namespace shogun
00022 {
00042 class CLinearRidgeRegression : public CLinearMachine
00043 {
00044     public:
00046         MACHINE_PROBLEM_TYPE(PT_REGRESSION);
00047 
00049         CLinearRidgeRegression();
00050 
00057         CLinearRidgeRegression(float64_t tau, CDenseFeatures<float64_t>* data, CLabels* lab);
00058         virtual ~CLinearRidgeRegression() {}
00059 
00064         inline void set_tau(float64_t tau) { m_tau = tau; };
00065 
00071         virtual bool load(FILE* srcfile);
00072 
00078         virtual bool save(FILE* dstfile);
00079 
00084         virtual EMachineType get_classifier_type()
00085         {
00086             return CT_LINEARRIDGEREGRESSION;
00087         }
00088 
00090         virtual const char* get_name() const { return "LinearRidgeRegression"; }
00091 
00092     protected:
00101         virtual bool train_machine(CFeatures* data=NULL);
00102 
00103     private:
00104         void init();
00105 
00106     protected:
00108         float64_t m_tau;
00109 };
00110 }
00111 #endif // HAVE_LAPACK
00112 #endif // _LINEARRIDGEREGRESSION_H__
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation