22 CMulticlassLogisticRegression::CMulticlassLogisticRegression() :
35 void CMulticlassLogisticRegression::init_defaults()
42 void CMulticlassLogisticRegression::register_parameters()
49 CMulticlassLogisticRegression::~CMulticlassLogisticRegression()
53 bool CMulticlassLogisticRegression::train_machine(
CFeatures* data)
58 REQUIRE(m_features,
"%s::train_machine(): No features attached!\n");
61 "Attached labels are no multiclass labels\n");
66 int32_t n_feats = m_features->get_dim_feature_space();
68 slep_options options = slep_options::default_options();
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);
85 options.tolerance = m_epsilon;
86 options.max_iter = m_max_iter;
91 for (int32_t i=0; i<n_classes; i++)
94 for (int32_t j=0; j<n_feats; j++)
104 #endif //USE_GPL_SHOGUN void set_epsilon(float64_t eps)
virtual ELabelType get_label_type() const =0
virtual void set_w(const SGVector< float64_t > src_w)
The class Labels models labels, i.e. class assignments of objects.
multi-class labels 0,1,...
CDynamicObjectArray * m_machines
CSGObject * get_element(int32_t index) const
Features that support dot products among other operations.
Multiclass Labels for multi-class classification.
generic linear multiclass machine
CMulticlassStrategy * m_multiclass_strategy
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
int32_t get_num_elements() const
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
virtual SGVector< float64_t > get_w() const
virtual float64_t get_bias()
virtual void set_bias(float64_t b)
void push_back(CSGObject *e)
multiclass one vs rest strategy used to train generic multiclass machines for K-class problems with b...