21 class CMultitaskL12LogisticRegression::Self
32 CMultitaskL12LogisticRegression::CMultitaskL12LogisticRegression() :
33 CMultitaskLogisticRegression(), self()
40 CMultitaskL12LogisticRegression::CMultitaskL12LogisticRegression(
42 CBinaryLabels* train_labels, CTaskGroup* task_group) :
43 CMultitaskLogisticRegression(0.0,train_features,train_labels,(CTaskRelation*)task_group)
50 void CMultitaskL12LogisticRegression::init()
56 void CMultitaskL12LogisticRegression::set_rho1(
float64_t rho1)
61 void CMultitaskL12LogisticRegression::set_rho2(
float64_t rho2)
66 float64_t CMultitaskL12LogisticRegression::get_rho1()
const
71 float64_t CMultitaskL12LogisticRegression::get_rho2()
const
76 CMultitaskL12LogisticRegression::~CMultitaskL12LogisticRegression()
80 bool CMultitaskL12LogisticRegression::train_locked_implementation(SGVector<index_t>* tasks)
82 SGVector<float64_t> y(m_labels->get_num_labels());
83 for (int32_t i=0; i<y.vlen; i++)
84 y[i] = ((CBinaryLabels*)m_labels)->get_label(i);
86 malsar_options options = malsar_options::default_options();
87 options.termination = m_termination;
88 options.tolerance = m_tolerance;
89 options.max_iter = m_max_iter;
90 options.n_tasks = ((CTaskGroup*)m_task_relation)->get_num_tasks();
91 options.tasks_indices = tasks;
92 malsar_result_t model = malsar_joint_feature_learning(
93 features, y.vector, self->m_rho1, self->m_rho2, options);
101 bool CMultitaskL12LogisticRegression::train_machine(CFeatures* data)
103 if (data && (CDotFeatures*)data)
104 set_features((CDotFeatures*)data);
110 SGVector<
float64_t> y(m_labels->get_num_labels());
111 for (int32_t i=0; i<y.vlen; i++)
112 y[i] = ((CBinaryLabels*)m_labels)->get_label(i);
114 malsar_options options = malsar_options::default_options();
115 options.termination = m_termination;
116 options.tolerance = m_tolerance;
117 options.max_iter = m_max_iter;
118 options.n_tasks = ((CTaskGroup*)m_task_relation)->get_num_tasks();
119 options.tasks_indices = ((CTaskGroup*)m_task_relation)->get_tasks_indices();
121 malsar_result_t model = malsar_joint_feature_learning(
122 features, y.vector, self->m_rho1, self->m_rho2, options);
127 SG_FREE(options.tasks_indices);
134 #endif //USE_GPL_SHOGUN
virtual bool init(CKernel *k)
all of classes and functions are contained in the shogun namespace