SHOGUN
v2.0.0
|
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 FEATUREBLOCKLOGISTICREGRESSION_H_ 00011 #define FEATUREBLOCKLOGISTICREGRESSION_H_ 00012 00013 #include <shogun/lib/config.h> 00014 #include <shogun/lib/IndexBlockRelation.h> 00015 #include <shogun/machine/LinearMachine.h> 00016 00017 namespace shogun 00018 { 00030 class CFeatureBlockLogisticRegression : public CLinearMachine 00031 { 00032 00033 public: 00034 MACHINE_PROBLEM_TYPE(PT_BINARY) 00035 00036 00037 CFeatureBlockLogisticRegression(); 00038 00046 CFeatureBlockLogisticRegression( 00047 float64_t z, CDotFeatures* training_data, 00048 CBinaryLabels* training_labels, CIndexBlockRelation* task_relation); 00049 00051 virtual ~CFeatureBlockLogisticRegression(); 00052 00054 virtual const char* get_name() const 00055 { 00056 return "FeatureBlockLogisticRegression"; 00057 } 00058 00062 CIndexBlockRelation* get_feature_relation() const; 00063 00067 void set_feature_relation(CIndexBlockRelation* feature_relation); 00068 00069 virtual float64_t apply_one(int32_t vec_idx); 00070 00072 int32_t get_max_iter() const; 00074 float64_t get_q() const; 00076 int32_t get_regularization() const; 00078 int32_t get_termination() const; 00080 float64_t get_tolerance() const; 00082 float64_t get_z() const; 00083 00085 void set_max_iter(int32_t max_iter); 00087 void set_q(float64_t q); 00089 void set_regularization(int32_t regularization); 00091 void set_termination(int32_t termination); 00093 void set_tolerance(float64_t tolerance); 00095 void set_z(float64_t z); 00096 00097 protected: 00098 00099 virtual SGVector<float64_t> apply_get_outputs(CFeatures* data); 00100 00102 virtual bool train_machine(CFeatures* data=NULL); 00103 00104 private: 00105 00107 void register_parameters(); 00108 00109 protected: 00110 00112 CIndexBlockRelation* m_feature_relation; 00113 00115 int32_t m_regularization; 00116 00118 int32_t m_termination; 00119 00121 int32_t m_max_iter; 00122 00124 float64_t m_tolerance; 00125 00127 float64_t m_q; 00128 00130 float64_t m_z; 00131 00132 }; 00133 } 00134 #endif