SHOGUN  6.0.0
MKLClassification.cpp
Go to the documentation of this file.
2 
4 
5 using namespace shogun;
6 
8 {
9  if (!s)
10  {
11 
12  if (!s)
13  s=new CLibSVM();
14  set_svm(s);
15  }
16 }
17 
19 {
20 }
22 {
23  float64_t suma=0;
24  int32_t nsv=svm->get_num_support_vectors();
25  for (int32_t i=0; i<nsv; i++)
26  suma+=CMath::abs(svm->get_alpha(i));
27 
28  return suma;
29 }
30 
32 {
33  REQUIRE(m_labels, "Labels not set.\n");
34  REQUIRE(m_labels->get_num_labels(), "Number of labels is zero.\n");
35  REQUIRE(m_labels->get_label_type() == LT_BINARY, "Labels must be binary.\n");
36 }
virtual ELabelType get_label_type() const =0
binary labels +1/-1
Definition: LabelTypes.h:18
LibSVM.
Definition: LibSVM.h:30
virtual int32_t get_num_labels() const =0
CLabels * m_labels
Definition: Machine.h:365
#define REQUIRE(x,...)
Definition: SGIO.h:205
CSVM * svm
Definition: MKL.h:409
double float64_t
Definition: common.h:60
float64_t get_alpha(int32_t idx)
Multiple Kernel Learning.
Definition: MKL.h:85
void set_svm(CSVM *s)
Definition: MKL.h:113
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
A generic Support Vector Machine Interface.
Definition: SVM.h:49
virtual float64_t compute_sum_alpha()
static T abs(T a)
Definition: Math.h:175

SHOGUN Machine Learning Toolbox - Documentation