-
Notifications
You must be signed in to change notification settings - Fork 3
/
compboost.h
107 lines (79 loc) · 3.16 KB
/
compboost.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// ========================================================================== //
// ___. __ //
// ____ ____ _____ ______\_ |__ ____ ____ _______/ |_ //
// _/ ___\/ _ \ / \\____ \| __ \ / _ \ / _ \/ ___/\ __\ //
// \ \__( <_> ) Y Y \ |_> > \_\ ( <_> | <_> )___ \ | | //
// \___ >____/|__|_| / __/|___ /\____/ \____/____ > |__| //
// \/ \/|__| \/ \/ //
// //
// ========================================================================== //
//
// Compboost is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Compboost is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with Compboost. If not, see <http://www.gnu.org/licenses/>.
//
// This file contains:
// -------------------
//
// The main "Compboost" class collects all used elements of the algorithm
// like loss, optimizer and logger and runs the main algorithm by calling
// the "Train" member function.
//
// Written by:
// -----------
//
// Daniel Schalk
// Institut für Statistik
// Ludwig-Maximilians-Universität München
// Ludwigstraße 33
// D-80539 München
//
// https://www.compstat.statistik.uni-muenchen.de
//
// =========================================================================== #
// THIS ONE IS UNDER PROGRESS!
#ifndef COMPBOOST_H_
#define COMPBOOST_H_
#include "baselearner_track.h"
#include "optimizer.h"
#include "loss.h"
#include "loggerlist.h"
namespace cboost {
// Main class:
class Compboost
{
private:
arma::vec response;
arma::vec pseudo_residuals;
arma::vec model_prediction;
double learning_rate;
double initialization;
bool stop_if_all_stopper_fulfilled;
// Pieces to run the algorithm:
blearnertrack::BaselearnerTrack blearner_track;
optimizer::Optimizer* used_optimizer;
loss::Loss* used_loss;
blearnerlist::BaselearnerList used_baselearner_list;
loggerlist::LoggerList* used_logger;
public:
Compboost ();
Compboost (arma::vec, double, bool, optimizer::Optimizer*, loss::Loss*,
loggerlist::LoggerList*, blearnerlist::BaselearnerList);
void TrainCompboost (bool);
arma::vec GetPrediction ();
std::map<std::string, arma::mat> GetParameter ();
std::vector<std::string> GetSelectedBaselearner ();
std::map<std::string, arma::mat> GetParameterOfIteration (unsigned int);
std::pair<std::vector<std::string>, arma::mat> GetParameterMatrix ();
// Destructor:
~Compboost ();
};
} // namespace cboost
#endif // COMPBOOST_H_