SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
MultitaskLeastSquaresRegression.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 Sergey Lisitsyn
00008  */
00009 
00010 #ifndef  MULTITASKLSREGRESSION_H_
00011 #define  MULTITASKLSREGRESSION_H_
00012 
00013 #include <shogun/lib/config.h>
00014 #include <shogun/transfer/multitask/TaskRelation.h>
00015 #include <shogun/transfer/multitask/MultitaskLinearMachine.h>
00016 
00017 namespace shogun
00018 {
00024 class CMultitaskLeastSquaresRegression : public CMultitaskLinearMachine
00025 {
00026 
00027     public:
00029         MACHINE_PROBLEM_TYPE(PT_REGRESSION)
00030 
00031         
00032         CMultitaskLeastSquaresRegression();
00033 
00041         CMultitaskLeastSquaresRegression(
00042              float64_t z, CDotFeatures* training_data, 
00043              CRegressionLabels* training_labels, CTaskRelation* task_relation);
00044 
00046         virtual ~CMultitaskLeastSquaresRegression();
00047 
00049         virtual const char* get_name() const 
00050         {
00051             return "MultitaskLeastSquaresRegression";
00052         }
00053         
00055         int32_t get_max_iter() const;
00057         float64_t get_q() const;
00059         int32_t get_regularization() const;
00061         int32_t get_termination() const;
00063         float64_t get_tolerance() const;
00065         float64_t get_z() const;
00066 
00068         void set_max_iter(int32_t max_iter);
00070         void set_q(float64_t q);
00072         void set_regularization(int32_t regularization);
00074         void set_termination(int32_t termination);
00076         void set_tolerance(float64_t tolerance);
00078         void set_z(float64_t z);
00079 
00081         virtual float64_t apply_one(int32_t i);
00082 
00083     protected:
00084 
00086         virtual bool train_machine(CFeatures* data=NULL);
00087 
00089         virtual bool train_locked_implementation(SGVector<index_t>* tasks);
00090 
00091     private:
00092 
00094         void register_parameters();
00095 
00097         void initialize_parameters();
00098 
00099     protected:
00100 
00102         int32_t m_regularization;
00103 
00105         int32_t m_termination;
00106 
00108         int32_t m_max_iter;
00109 
00111         float64_t m_tolerance;
00112 
00114         float64_t m_q;
00115 
00117         float64_t m_z;
00118 
00119 };
00120 }
00121 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation