SHOGUN  v3.2.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义 
ShareBoost.h
浏览该文件的文档.
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) 2012 Chiyuan Zhang
8  * Copyright (C) 2012 Chiyuan Zhang
9  */
10 
11 #ifndef SHAREBOOST_H__
12 #define SHAREBOOST_H__
13 
18 
19 namespace shogun
20 {
21 
31 {
32 public:
34  CShareBoost();
35 
37  CShareBoost(CDenseFeatures<float64_t> *features, CMulticlassLabels *labs, int32_t num_nonzero_feas);
38 
40  virtual ~CShareBoost() {}
41 
43  virtual const char* get_name() const { return "ShareBoost"; }
44 
46  void set_num_nonzero_feas(int32_t n) { m_nonzero_feas = n; }
47 
49  int32_t get_num_nonzero_feas() const { return m_nonzero_feas; }
50 
52  void set_features(CFeatures *f);
53 
56 
57  friend class ShareBoostOptimizer;
58 protected:
59 
61  virtual bool train_machine(CFeatures* data = NULL);
62 
63 private:
64  void init_sb_params();
65 
66  void compute_rho();
67  int32_t choose_feature();
68  void optimize_coefficients();
69  void compute_pred();
70  void compute_pred(const float64_t *W);
71 
72  int32_t m_nonzero_feas;
73  SGVector<int32_t> m_activeset;
74 
75  SGMatrix<float64_t> m_fea;
76  SGMatrix<float64_t> m_rho;
77  SGVector<float64_t> m_rho_norm;
78  SGMatrix<float64_t> m_pred;
79 };
80 
81 } /* shogun */
82 
83 #endif /* end of include guard: SHAREBOOST_H__ */
84 
SGVector< int32_t > get_activeset()
Definition: ShareBoost.cpp:39
int32_t get_num_nonzero_feas() const
Definition: ShareBoost.h:49
void set_features(CFeatures *f)
Definition: ShareBoost.cpp:197
Multiclass Labels for multi-class classification.
generic linear multiclass machine
virtual const char * get_name() const
Definition: ShareBoost.h:43
double float64_t
Definition: common.h:48
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
virtual bool train_machine(CFeatures *data=NULL)
Definition: ShareBoost.cpp:44
The class Features is the base class of all feature objects.
Definition: Features.h:62
virtual ~CShareBoost()
Definition: ShareBoost.h:40
void set_num_nonzero_feas(int32_t n)
Definition: ShareBoost.h:46

SHOGUN Machine Learning Toolbox - Documentation