SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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  SG_WARNING("%s::CMulticlassStrategy(): register parameters!\n", get_name());
46 }
47 
49 {
50  if (m_train_labels != NULL)
51  SG_ERROR("Stop the previous training task before starting a new one!")
52  SG_REF(train_labels);
53  m_train_labels=train_labels;
54  SG_REF(orig_labels);
55  m_orig_labels=orig_labels;
56  m_train_iter=0;
57 }
58 
60 {
61  m_train_iter++;
62  return SGVector<int32_t>();
63 }
64 
66 {
69  m_train_labels = NULL;
70  m_orig_labels = NULL;
71 }

SHOGUN Machine Learning Toolbox - Documentation