13 #ifndef _DENSE_LABELS__H__
14 #define _DENSE_LABELS__H__
122 template<
typename ST>
125 REQUIRE(idx<
get_num_labels(),
"The provided index (%d) is out of bounds (the last label has index (%d)). "
126 "Please ensure that you're using a valid index number.", idx,
get_num_labels())
128 "Please ensure that you initialized the labels correctly.")
155 template<
typename ST>
159 return get_labels_copy_t<ST>();
174 template<
typename ST>
190 for (
index_t i=0; i<num_labels; i++)
191 result[i] = get_label_t<ST>(i);
243 #if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
285 if (m_subset_stack->has_subsets())
286 return get_labels_copy_t<float64_t>();
SGVector< float64_t > m_labels
void set_int_labels(SGVector< int32_t > labels)
virtual int32_t get_num_labels() const
The class Labels models labels, i.e. class assignments of objects.
virtual ELabelType get_label_type() const =0
CSubsetStack * m_subset_stack
float64_t get_label(int32_t idx)
SGVector< float64_t > get_labels_copy()
bool set_label(int32_t idx, float64_t label)
SGVector< float64_t > get_labels()
int32_t get_int_label(int32_t idx)
static const int32_t REJECTION_LABEL
A File access base class.
index_t subset_idx_conversion(index_t idx) const
void set_to_const(float64_t c)
SGVector< int32_t > get_int_labels()
all of classes and functions are contained in the shogun namespace
virtual void ensure_valid(const char *context=NULL)
bool set_int_label(int32_t idx, int32_t label)
virtual bool has_subsets() const
Dense integer or floating point labels.
ST get_label_t(int32_t idx)
SGVector< ST > get_labels_copy_t()
void set_labels(SGVector< float64_t > v)
virtual void load(CFile *loader)
virtual void save(CFile *writer)
SGVector< ST > get_labels_t()