SHOGUN  4.2.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RegressionLabels.cpp
Go to the documentation of this file.
3 
4 using namespace shogun;
5 
7 {
8 }
9 
10 CRegressionLabels::CRegressionLabels(int32_t num_labels) : CDenseLabels(num_labels)
11 {
12 }
13 
15 {
16  set_labels(src);
17 }
18 
20 {
21 }
22 
24 {
25  return LT_REGRESSION;
26 }
27 
29 {
30  CLabels* shallow_copy_labels=NULL;
31  SGVector<float64_t> shallow_copy_vector(m_labels);
32  shallow_copy_labels=new CRegressionLabels(m_labels.size());
33  SG_REF(shallow_copy_labels);
34 
35  ((CDenseLabels*) shallow_copy_labels)->set_labels(shallow_copy_vector);
37  shallow_copy_labels->add_subset(m_subset_stack->get_last_subset()->get_subset_idx());
38 
39  return shallow_copy_labels;
40 }
SGVector< index_t > get_subset_idx() const
Definition: Subset.h:48
SGVector< float64_t > m_labels
Definition: DenseLabels.h:271
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
real valued labels (e.g. for regression, classifier outputs)
Definition: LabelTypes.h:22
CSubsetStack * m_subset_stack
Definition: Labels.h:140
#define SG_REF(x)
Definition: SGObject.h:54
CSubset * get_last_subset() const
Definition: SubsetStack.h:98
int32_t size() const
Definition: SGVector.h:113
A File access base class.
Definition: File.h:34
virtual void add_subset(SGVector< index_t > subset)
Definition: Labels.cpp:39
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual bool has_subsets() const
Definition: SubsetStack.h:89
virtual CLabels * shallow_subset_copy()
virtual ELabelType get_label_type() const
Dense integer or floating point labels.
Definition: DenseLabels.h:35
void set_labels(SGVector< float64_t > v)
Definition: DenseLabels.cpp:74
ELabelType
Definition: LabelTypes.h:15

SHOGUN Machine Learning Toolbox - Documentation