28 #if !defined(SWIGJAVA) && !defined(SWIGCSHARP)
32 for (int32_t i = 0; i < values.
vlen; i++)
43 for (int32_t i = 0; i < values.
vlen; i++)
55 for (int32_t i = 0; i < labels.
vlen; i++)
57 labels[i] = src[i] + threshold >= 0 ? +1.0 : -1.0;
70 bool found_plus_one =
false;
71 bool found_minus_one =
false;
74 for (int32_t i = 0; i < subset_size; i++)
79 found_plus_one =
true;
83 found_minus_one =
true;
88 "%s%s%s::ensure_valid(): Not a two class labeling label[%d]=%f (only +1/-1 "
89 "allowed)\n", context ? context :
"",
97 "%s%s%s::ensure_valid(): Not a two class labeling - no positively labeled examples found\n",
98 context ? context :
"", context ?
": " :
"",
get_name());
101 if (!found_minus_one)
104 "%s%s%s::ensure_valid): Not a two class labeling - no negatively labeled examples found\n",
105 context ? context :
"", context ?
": " :
"",
get_name());
116 SG_DEBUG(
"entering CBinaryLabels::scores_to_probabilities()\n")
121 if (a == 0 && b == 0)
129 SG_DEBUG(
"using sigmoid: a=%f, b=%f\n", a, b)
139 SG_DEBUG(
"leaving CBinaryLabels::scores_to_probabilities()\n")
144 CLabels* shallow_copy_labels=NULL;
147 SG_REF(shallow_copy_labels);
149 ((
CDenseLabels*) shallow_copy_labels)->set_labels(shallow_copy_vector);
153 return shallow_copy_labels;
SGVector< index_t > get_subset_idx() const
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.
CSubsetStack * m_subset_stack
CSubset * get_last_subset() const
static SigmoidParamters fit_sigmoid(SGVector< float64_t > scores)
A File access base class.
virtual void add_subset(SGVector< index_t > subset)
index_t subset_idx_conversion(index_t idx) const
virtual void ensure_valid(const char *context=NULL)
virtual const char * get_name() const
virtual CLabels * shallow_subset_copy()
all of classes and functions are contained in the shogun namespace
virtual void ensure_valid(const char *context=NULL)
static float64_t exp(float64_t x)
void scores_to_probabilities(float64_t a=0, float64_t b=0)
virtual bool has_subsets() const
SGVector< float64_t > m_current_values
Dense integer or floating point labels.
virtual void set_values(SGVector< float64_t > values)
void set_labels(SGVector< float64_t > v)
virtual ELabelType get_label_type() const