26 void CKNNSolver::init()
40 for (int32_t j=0; j<
m_k; j++)
42 classes[train_lab[j]]+= multiplier;
43 multiplier*= multiplier;
52 if (out_max< classes[j])
69 classes[train_lab[j]]++;
77 if (out_max< classes[c])
int32_t m_k
the k parameter in KNN
SGVector< int32_t > m_train_labels
int32_t choose_class(float64_t *classes, const int32_t *train_lab) const
A generic DistanceMachine interface.
void choose_class_for_multiple_k(int32_t *output, int32_t *classes, const int32_t *train_lab, const int32_t step) const
int32_t m_num_classes
number of classes (i.e. number of values labels can take)
int32_t m_min_label
smallest label, i.e. -1
all of classes and functions are contained in the shogun namespace
float64_t m_q
parameter q of rank weighting