SHOGUN
v3.2.0
|
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) 1999-2012 Soeren Sonnenburg and Sergey Lisitsyn 00008 * Written (W) 2012 Heiko Strathmann 00009 * Copyright (C) 1999-2012 Fraunhofer Institute FIRST and Max-Planck-Society 00010 */ 00011 00012 #ifndef _KERNELMULTICLASSMACHINE_H___ 00013 #define _KERNELMULTICLASSMACHINE_H___ 00014 00015 #include <shogun/lib/common.h> 00016 #include <shogun/features/Features.h> 00017 #include <shogun/kernel/Kernel.h> 00018 #include <shogun/machine/KernelMachine.h> 00019 #include <shogun/machine/MulticlassMachine.h> 00020 00021 namespace shogun 00022 { 00023 00024 class CKernel; 00025 class CKernelMachine; 00026 00028 class CKernelMulticlassMachine : public CMulticlassMachine 00029 { 00030 public: 00032 CKernelMulticlassMachine(); 00033 00040 CKernelMulticlassMachine(CMulticlassStrategy *strategy, CKernel* kernel, CKernelMachine* machine, CLabels* labs); 00041 00043 virtual ~CKernelMulticlassMachine(); 00044 00046 virtual const char* get_name() const 00047 { 00048 return "KernelMulticlassMachine"; 00049 } 00050 00055 void set_kernel(CKernel* k); 00056 00061 CKernel* get_kernel(); 00062 00069 virtual void store_model_features(); 00070 00071 protected: 00072 00074 virtual bool init_machine_for_train(CFeatures* data); 00075 00077 virtual bool init_machines_for_apply(CFeatures* data); 00078 00080 virtual bool is_ready(); 00081 00083 virtual CMachine* get_machine_from_trained(CMachine* machine); 00084 00086 virtual int32_t get_num_rhs_vectors(); 00087 00092 virtual void add_machine_subset(SGVector<index_t> subset); 00093 00095 virtual void remove_machine_subset(); 00096 00097 protected: 00098 00100 CKernel* m_kernel; 00101 00102 }; 00103 } 00104 #endif