-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboost.h
47 lines (36 loc) · 1.08 KB
/
boost.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
#ifndef __BOOST_H__
#define __BOOST_H__
#include "utilites.h"
#include "cart.h"
using namespace std;
class binary_cart_boost_classifier
{
public:
binary_cart_boost_classifier(int number_of_models,double data_prc,double feature_prc);
~binary_cart_boost_classifier();
double predict(vector<double>& sample);
void predict(vector<vector<double> >* data,vector<double>* predicted);
void train(vector<vector<double> >* data,vector<int>* answ_);
CART_binar_classifier* models;
double* weights;
int number_of_models;
double data_prc;
double feature_prc;
private:
vector<vector<int>* > selected_features;
vector<vector<int>* > selected_data;
vector<vector<double> >* data;
vector<int>* answ;
};
class boost_classifier
{
public:
boost_classifier(int num_trees,double data_prc,double feature_prc);
~boost_classifier();
void predict(vector<vector<double> >* data_in,vector<int>* answ_out);
void train(vector<vector<double> >* data_,vector<int>* answ_);
private:
vector<vector<double> > data;
vector<int> answ;
};
#endif