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 * Copyright (W) 2012 Sergey Lisitsyn 00008 */ 00009 00010 #ifndef KERNELMEANMATCHING_H_ 00011 #define KERNELMEANMATCHING_H_ 00012 00013 #include <shogun/base/SGObject.h> 00014 #include <shogun/kernel/Kernel.h> 00015 00016 namespace shogun 00017 { 00018 00020 class CKernelMeanMatching: public CSGObject 00021 { 00022 public: 00023 00025 CKernelMeanMatching(); 00026 00028 CKernelMeanMatching(CKernel* kernel, SGVector<index_t> training_indices, SGVector<index_t> test_indices); 00029 00031 CKernel* get_kernel() const { SG_REF(m_kernel); return m_kernel; } 00033 void set_kernel(CKernel* kernel) { SG_REF(kernel); SG_UNREF(m_kernel); m_kernel = kernel; } 00035 SGVector<index_t> get_training_indices() const { return m_training_indices; } 00037 void set_training_indices(SGVector<index_t> training_indices) { m_training_indices = training_indices; } 00039 SGVector<index_t> get_test_indices() const { return m_test_indices; } 00041 void set_test_indices(SGVector<index_t> test_indices) { m_test_indices = test_indices; } 00042 00044 SGVector<float64_t> compute_weights(); 00045 00046 virtual const char* get_name() const { return "KernelMeanMatching"; } 00047 00048 protected: 00049 00051 CKernel* m_kernel; 00053 SGVector<index_t> m_training_indices; 00055 SGVector<index_t> m_test_indices; 00056 }; 00057 00058 } 00059 #endif