00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2009 Soeren Sonnenburg 00008 * Written (W) 2009 Marius Kloft 00009 * Copyright (C) 2009 TU Berlin and Max-Planck-Society 00010 */ 00011 00012 #ifndef _SCATTERSVM_H___ 00013 #define _SCATTERSVM_H___ 00014 00015 #include "lib/common.h" 00016 #include "classifier/svm/MultiClassSVM.h" 00017 #include "classifier/svm/SVM_libsvm.h" 00018 00019 #include <stdio.h> 00020 00021 namespace shogun 00022 { 00035 class CScatterSVM : public CMultiClassSVM 00036 { 00037 public: 00039 CScatterSVM(); 00046 CScatterSVM(float64_t C, CKernel* k, CLabels* lab); 00047 00049 virtual ~CScatterSVM(); 00050 00059 virtual bool train(CFeatures* data=NULL); 00060 00065 virtual inline EClassifierType get_classifier_type() { return CT_SCATTERSVM; } 00066 00072 virtual float64_t classify_example(int32_t num); 00073 00078 virtual CLabels* classify_one_vs_rest(); 00079 00081 inline virtual const char* get_name() const { return "ScatterSVM"; } 00082 00083 private: 00084 void compute_norm_wc(); 00085 00086 protected: 00088 svm_problem problem; 00090 svm_parameter param; 00091 00093 struct svm_model* model; 00094 00096 float64_t* norm_wc; 00097 00099 float64_t* norm_wcw; 00100 00102 float64_t rho; 00103 }; 00104 } 00105 #endif // ScatterSVM