22     register_parameters();
 
   28     register_parameters();
 
   31 void CMulticlassOneVsOneStrategy::register_parameters()
 
  125         if (votes[i] > vote_max)
 
  129             dec_val_max = dec_vals[i];
 
  131         else if (votes[i] == vote_max)
 
  133             if (dec_vals[i] > dec_val_max)
 
  136                 dec_val_max = dec_vals[i];
 
  164         SG_ERROR(
"%s::rescale_output(): size(outputs) is not num_machines.\n", 
get_name());
 
  180             SG_ERROR(
"%s::rescale_outputs(): Unknown OVO probability heuristic type!\n", 
get_name());
 
  190         SG_ERROR(
"%s::rescale_heuris_price(): size(outputs) = %d != m_num_machines = %d\n",
 
  202                 new_outputs[j] += 1.0 / (outputs[m]+1E-12);
 
  204                 new_outputs[j] += 1.0 / (1.0-outputs[m]+1E-12);
 
  207         new_outputs[j] = 1.0 / (new_outputs[j] - m_num_classes + 2);
 
  213     for (int32_t i=0; i<new_outputs.
vlen; i++)
 
  214         outputs[i] = new_outputs[i] / norm;
 
  222         SG_ERROR(
"%s::rescale_heuris_hastie(): size(outputs) = %d != m_num_machines = %d\n",
 
  234                 new_outputs[j] += outputs[m];
 
  236                 new_outputs[j] += 1.0-outputs[m];
 
  239         new_outputs[j] *= 2.0 / (m_num_classes * (m_num_classes - 1));
 
  240         new_outputs[j] += 1E-10;
 
  249         prev_outputs = new_outputs.
clone();
 
  252             mu[m] = new_outputs[indx1[m]] / (new_outputs[indx1[m]] + new_outputs[indx2[m]]);
 
  274             new_outputs[j] *= numerator / denominator;
 
  278         for (int32_t i=0; i<new_outputs.
vlen; i++)
 
  279             new_outputs[i] /= norm;
 
  282         for (int32_t i=0; i<new_outputs.
vlen; i++)
 
  283             prev_outputs[i] -= new_outputs[i];
 
  286         SG_DEBUG(
"[Hastie's heuristic] gap = %.12f\n", gap);
 
  289     for (int32_t i=0; i<new_outputs.
vlen; i++)
 
  290         outputs[i] = new_outputs[i];
 
  298         SG_ERROR(
"%s::rescale_heuris_hamamura(): size(outputs) = %d != m_num_machines = %d\n",
 
  310                 new_outputs[j] *= outputs[m];
 
  312                 new_outputs[j] *= 1-outputs[m];
 
  315         new_outputs[j] += 1E-10;
 
  320     for (int32_t i=0; i<new_outputs.
vlen; i++)
 
  321         outputs[i] = new_outputs[i] / norm;
 
virtual SGVector< int32_t > train_prepare_next()
int32_t m_train_pair_idx_2
2nd index of current submachine being trained 
double norm(double *v, double p, int n)
static void fill_vector(T *vec, int32_t len, T value)
void rescale_heuris_hamamura(SGVector< float64_t > outputs, const SGVector< int32_t > indx1, const SGVector< int32_t > indx2)
CMulticlassLabels * m_orig_labels
original multiclass labels 
static int32_t arg_max(T *vec, int32_t inc, int32_t len, T *maxv_ptr=NULL)
virtual int32_t get_num_labels() const 
virtual void train_start(CMulticlassLabels *orig_labels, CBinaryLabels *train_labels)
int32_t m_train_pair_idx_1
1st index of current submachine being trained 
SGVector< int32_t > m_num_samples
number of samples per machine 
CMulticlassOneVsOneStrategy()
int32_t m_num_classes
number of classes in this problem 
Multiclass Labels for multi-class classification. 
void rescale_heuris_hastie(SGVector< float64_t > outputs, const SGVector< int32_t > indx1, const SGVector< int32_t > indx2)
int32_t m_train_iter
index of current iterations 
virtual const char * get_name() const 
virtual void rescale_outputs(SGVector< float64_t > outputs)
static T sum(T *vec, int32_t len)
Return sum(vec) 
virtual bool train_has_more()
void rescale_heuris_price(SGVector< float64_t > outputs, const SGVector< int32_t > indx1, const SGVector< int32_t > indx2)
all of classes and functions are contained in the shogun namespace 
CBinaryLabels * m_train_labels
labels used to train the submachines 
int32_t m_num_machines
number of machines 
SGVector< T > clone() const 
Binary Labels for binary classification. 
class MulticlassStrategy used to construct generic multiclass classifiers with ensembles of binary cl...
static T qsq(T *x, int32_t len, float64_t q)
|| x ||_q^q 
void resize_vector(int32_t n)
virtual SGVector< int32_t > train_prepare_next()
virtual void train_start(CMulticlassLabels *orig_labels, CBinaryLabels *train_labels)
EProbHeuristicType get_prob_heuris_type()
virtual int32_t decide_label(SGVector< float64_t > outputs)