36 for ( int32_t i = 0 ; i < src.
vlen ; ++i )
38 if ( src[i] < 0 || src[i] >= m_num_classes )
39 SG_ERROR(
"Found label out of {0, 1, 2, ..., num_classes-1}")
55 SG_ERROR(
"Index must be inside [0, num_labels-1]\n")
67 if (m_num_labels_set >= m_labels_vector.
vlen)
73 m_labels_vector[m_num_labels_set] = value;
88 m_labels_vector[real_idx] = value;
99 return m_num_labels_set;
102 void CMulticlassSOLabels::init()
104 SG_ADD(&m_num_classes,
"m_num_classes",
"The number of classes",
106 SG_ADD(&m_num_labels_set,
"m_num_labels_set",
"The number of assigned labels",
110 m_num_labels_set = 0;
Base class of the labels used in Structured Output (SO) problems.
virtual CStructuredData * get_label(int32_t idx)
virtual ~CMulticlassSOLabels()
CSubsetStack * m_subset_stack
static CRealNumber * obtain_from_generic(CStructuredData *base_data)
virtual int32_t get_num_labels() const
index_t subset_idx_conversion(index_t idx) const
all of classes and functions are contained in the shogun namespace
virtual void add_label(CStructuredData *label)
void resize_vector(int32_t n)
virtual bool set_label(int32_t idx, CStructuredData *label)
Class CRealNumber to be used in the application of Structured Output (SO) learning to multiclass clas...
Base class of the components of StructuredLabels.