MKLClassification.cpp

Go to the documentation of this file.
00001 #include <shogun/classifier/mkl/MKLClassification.h>
00002 #ifdef USE_SVMLIGHT
00003 #include <shogun/classifier/svm/SVMLight.h>
00004 #endif //USE_SVMLIGHT
00005 #include <shogun/classifier/svm/LibSVM.h>
00006 
00007 using namespace shogun;
00008 
00009 CMKLClassification::CMKLClassification(CSVM* s) : CMKL(s)
00010 {
00011     if (!s)
00012     {
00013 #ifdef USE_SVMLIGHT
00014         s=new CSVMLight();
00015 #endif //USE_SVMLIGHT
00016         if (!s)
00017             s=new CLibSVM();
00018         set_svm(s);
00019     }
00020 }
00021 
00022 CMKLClassification::~CMKLClassification()
00023 {
00024 }
00025 float64_t CMKLClassification::compute_sum_alpha()
00026 {
00027     float64_t suma=0;
00028     int32_t nsv=svm->get_num_support_vectors();
00029     for (int32_t i=0; i<nsv; i++)
00030         suma+=CMath::abs(svm->get_alpha(i));
00031 
00032     return suma;
00033 }
00034 
00035 void CMKLClassification::init_training()
00036 {
00037     ASSERT(labels && labels->get_num_labels() && labels->is_two_class_labeling());
00038 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation