SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LabelsFactory.cpp
Go to the documentation of this file.
2 
9 
10 using namespace shogun;
11 
13 {
14  ASSERT(base_labels != NULL)
15  if (base_labels->get_label_type() == LT_BINARY)
16  return static_cast<CBinaryLabels*>(base_labels);
17  else
18  SG_SERROR("base_labels must be of dynamic type CBinaryLabels")
19 
20  return NULL;
21 }
22 
24 {
25  ASSERT(base_labels != NULL)
26  if (base_labels->get_label_type() == LT_LATENT)
27  return static_cast<CLatentLabels*>(base_labels);
28  else
29  SG_SERROR("base_labels must be of dynamic type CLatentLabels\n")
30 
31  return NULL;
32 }
33 
35 {
36  ASSERT(base_labels != NULL)
37  if (base_labels->get_label_type() == LT_MULTICLASS)
38  return static_cast<CMulticlassLabels*>(base_labels);
39  else
40  SG_SERROR("base_labels must be of dynamic type CMulticlassLabels\n")
41 
42  return NULL;
43 }
44 
46 {
47  ASSERT(base_labels != NULL)
48  if (base_labels->get_label_type() == LT_REGRESSION)
49  return static_cast<CRegressionLabels*>(base_labels);
50  else
51  SG_SERROR("base_labels must be of dynamic type CRegressionLabels")
52 
53  return NULL;
54 }
55 
57 {
58  ASSERT(base_labels != NULL)
59  if (base_labels->get_label_type() == LT_STRUCTURED)
60  return static_cast<CStructuredLabels*>(base_labels);
61  else
62  SG_SERROR("base_labels must be of dynamic type CStructuredLabels\n")
63 
64  return NULL;
65 }
66 
67 
69 {
70  ASSERT(base_labels != NULL)
71  if (base_labels->get_label_type() == LT_MULTICLASS_MULTIPLE_OUTPUT)
72  return static_cast<CMulticlassMultipleOutputLabels*>(base_labels);
73  else
74  SG_SERROR("base_labels must be of dynamic type CMulticlassMultipleOutputLabels\n")
75 
76  return NULL;
77 }

SHOGUN Machine Learning Toolbox - Documentation