SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MKLClassification.cpp
Go to the documentation of this file.
2 #ifdef USE_SVMLIGHT
4 #endif //USE_SVMLIGHT
6 
7 using namespace shogun;
8 
10 {
11  if (!s)
12  {
13 #ifdef USE_SVMLIGHT
14  s=new CSVMLight();
15 #endif //USE_SVMLIGHT
16  if (!s)
17  s=new CLibSVM();
18  set_svm(s);
19  }
20 }
21 
23 {
24 }
26 {
27  float64_t suma=0;
28  int32_t nsv=svm->get_num_support_vectors();
29  for (int32_t i=0; i<nsv; i++)
30  suma+=CMath::abs(svm->get_alpha(i));
31 
32  return suma;
33 }
34 
36 {
37  REQUIRE(m_labels, "Labels not set.\n");
38  REQUIRE(m_labels->get_num_labels(), "Number of labels is zero.\n");
39  REQUIRE(m_labels->get_label_type() == LT_BINARY, "Labels must be binary.\n");
40 }

SHOGUN Machine Learning Toolbox - Documentation