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) 2013 Viktor Gal 00008 * Copyright (C) 2013 Viktor Gal 00009 */ 00010 00011 #include <shogun/ensemble/MajorityVote.h> 00012 #include <shogun/lib/SGMatrix.h> 00013 00014 using namespace shogun; 00015 00016 CMajorityVote::CMajorityVote() 00017 : CWeightedMajorityVote() 00018 { 00019 00020 } 00021 00022 CMajorityVote::~CMajorityVote() 00023 { 00024 00025 } 00026 00027 SGVector<float64_t> CMajorityVote::combine(const SGMatrix<float64_t>& ensemble_result) const 00028 { 00029 m_weights.resize_vector(ensemble_result.num_cols); 00030 m_weights.set_const(1.0); 00031 00032 SGVector<float64_t> combined_result = CWeightedMajorityVote::combine(ensemble_result); 00033 00034 return combined_result; 00035 } 00036 00037 float64_t CMajorityVote::combine(const SGVector<float64_t>& ensemble_result) const 00038 { 00039 m_weights.resize_vector(ensemble_result.vlen); 00040 m_weights.set_const(1.0); 00041 00042 return weighted_combine(ensemble_result); 00043 }