21 CMulticlassTreeGuidedLogisticRegression::CMulticlassTreeGuidedLogisticRegression() :
35 void CMulticlassTreeGuidedLogisticRegression::init_defaults()
43 void CMulticlassTreeGuidedLogisticRegression::register_parameters()
50 CMulticlassTreeGuidedLogisticRegression::~CMulticlassTreeGuidedLogisticRegression()
55 bool CMulticlassTreeGuidedLogisticRegression::train_machine(
CFeatures* data)
62 ASSERT(m_multiclass_strategy)
66 int32_t n_feats = m_features->get_dim_feature_space();
68 slep_options options = slep_options::default_options();
69 if (m_machines->get_num_elements()!=0)
73 for (int32_t i=0; i<n_classes; i++)
77 for (int32_t j=0; j<n_feats; j++)
78 all_w_old(j,i) = w[j];
82 options.last_result =
new slep_result_t(all_w_old,all_c_old);
83 m_machines->reset_array();
85 if (m_index_tree->is_general())
91 options.ind_t = ind_t.
vector;
92 options.n_nodes = ind_t.
size()/3;
93 options.tolerance = m_epsilon;
94 options.max_iter = m_max_iter;
95 slep_result_t result = slep_mc_tree_lr(m_features,(
CMulticlassLabels*)m_labels,m_z,options);
99 for (int32_t i=0; i<n_classes; i++)
102 for (int32_t j=0; j<n_feats; j++)
108 m_machines->push_back(machine);
112 #endif //USE_GPL_SHOGUN
virtual void set_w(const SGVector< float64_t > src_w)
The class Labels models labels, i.e. class assignments of objects.
class IndexBlockTree used to represent tree guided feature relation.
multi-class labels 0,1,...
Features that support dot products among other operations.
Multiclass Labels for multi-class classification.
generic linear multiclass machine
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
virtual SGVector< float64_t > get_w() const
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual float64_t get_bias()
virtual void set_bias(float64_t b)
void set_epsilon(float *begin, float max)
multiclass one vs rest strategy used to train generic multiclass machines for K-class problems with b...