SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MulticlassStrategy.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2012 Chiyuan Zhang
8  * Written (W) 2013 Shell Hu and Heiko Strathmann
9  * Copyright (C) 2012 Chiyuan Zhang
10  */
11 
14 
15 using namespace shogun;
16 
17 
19  : CSGObject()
20 {
21  init();
22 }
23 
25  : CSGObject()
26 {
27  init();
28 
29  m_prob_heuris=prob_heuris;
30 }
31 
32 void CMulticlassStrategy::init()
33 {
35  m_train_labels=NULL;
36  m_orig_labels=NULL;
37  m_train_iter=0;
39  m_num_classes=0;
40 
41  SG_ADD((CSGObject**)&m_rejection_strategy, "rejection_strategy", "Strategy of rejection", MS_NOT_AVAILABLE);
42  SG_ADD(&m_num_classes, "num_classes", "Number of classes", MS_NOT_AVAILABLE);
43  SG_ADD((machine_int_t*)&m_prob_heuris, "prob_heuris", "Probability estimation heuristics", MS_NOT_AVAILABLE);
44 }
45 
47 {
48  if (m_train_labels != NULL)
49  SG_ERROR("Stop the previous training task before starting a new one!")
50  SG_REF(train_labels);
51  m_train_labels=train_labels;
52  SG_REF(orig_labels);
53  m_orig_labels=orig_labels;
54  m_train_iter=0;
55 }
56 
58 {
59  m_train_iter++;
60  return SGVector<int32_t>();
61 }
62 
64 {
67  m_train_labels = NULL;
68  m_orig_labels = NULL;
69 }
CMulticlassLabels * m_orig_labels
original multiclass labels
#define SG_ERROR(...)
Definition: SGIO.h:129
CRejectionStrategy * m_rejection_strategy
rejection strategy
#define SG_REF(x)
Definition: SGObject.h:51
int32_t m_num_classes
number of classes in this problem
Multiclass Labels for multi-class classification.
EProbHeuristicType m_prob_heuris
prob output heuristic
int32_t m_train_iter
index of current iterations
Class SGObject is the base class of all shogun objects.
Definition: SGObject.h:112
#define SG_UNREF(x)
Definition: SGObject.h:52
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
CBinaryLabels * m_train_labels
labels used to train the submachines
int machine_int_t
Definition: common.h:59
Binary Labels for binary classification.
Definition: BinaryLabels.h:37
virtual SGVector< int32_t > train_prepare_next()
#define SG_ADD(...)
Definition: SGObject.h:81
virtual void train_start(CMulticlassLabels *orig_labels, CBinaryLabels *train_labels)

SHOGUN Machine Learning Toolbox - Documentation