SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MajorityVote.cpp
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2013 Viktor Gal
8  * Copyright (C) 2013 Viktor Gal
9  */
10 
12 #include <shogun/lib/SGMatrix.h>
13 
14 using namespace shogun;
15 
18 {
19 
20 }
21 
23 {
24 
25 }
26 
28 {
29  m_weights.resize_vector(ensemble_result.num_cols);
30  m_weights.set_const(1.0);
31 
32  SGVector<float64_t> combined_result = CWeightedMajorityVote::combine(ensemble_result);
33 
34  return combined_result;
35 }
36 
38 {
39  m_weights.resize_vector(ensemble_result.vlen);
40  m_weights.set_const(1.0);
41 
42  return weighted_combine(ensemble_result);
43 }
virtual SGVector< float64_t > combine(const SGMatrix< float64_t > &ensemble_result) const
index_t num_cols
Definition: SGMatrix.h:378
Weighted Majority Vote implementation.
index_t vlen
Definition: SGVector.h:494
double float64_t
Definition: common.h:50
virtual SGVector< float64_t > combine(const SGMatrix< float64_t > &ensemble_result) const
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
void resize_vector(int32_t n)
Definition: SGVector.cpp:259
virtual float64_t weighted_combine(const SGVector< float64_t > &ensemble_result) const
void set_const(T const_elem)
Definition: SGVector.cpp:152

SHOGUN Machine Learning Toolbox - Documentation