-
Notifications
You must be signed in to change notification settings - Fork 21
/
randomforest.hpp
45 lines (35 loc) · 1.34 KB
/
randomforest.hpp
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
#ifndef RANDOMFOREST_H
#define RANDOMFOREST_H
#include <ostream>
#include "random-forest/node-gini.hpp"
#include "random-forest/forest.hpp"
#include "classifier.hpp"
namespace rf {
typedef liblearning::RandomForest::RandomForest< liblearning::RandomForest::NodeGini<liblearning::RandomForest::AxisAlignedSplitter> > RandomForest;
typedef liblearning::RandomForest::AxisAlignedRandomSplitGenerator AxisAlignedRandomSplitGenerator;
typedef liblearning::RandomForest::ForestParams ForestParams;
typedef liblearning::DataView2D<int> LabelDataView;
typedef liblearning::DataView2D<float> FeatureDataView;
RandomForest *train(const std::vector<std::string> &filenames,
double *startResolution,
int numScales,
int numTrees,
int treeDepth,
double radius,
int maxSamples,
const std::vector<int> &classes);
RandomForest *loadForest(const std::string &modelFilename);
void saveForest(RandomForest *rtrees, const std::string &modelFilename);
void classify(PointSet &pointSet,
RandomForest *rtrees,
const std::vector<Feature *> &features,
const std::vector<Label> &labels,
Regularization regularization = Regularization::None,
double regRadius = 2.5,
bool useColors = false,
bool unclassifiedOnly = false,
bool evaluate = false,
const std::vector<int> &skip = {},
const std::string &statsFile = "");
}
#endif