koho.cpp  1.1.0
Classes | Typedefs | Functions | Variables
koho Namespace Reference

Classes

class  BestSplitter
 Splitter to find the best split for a node. More...
 
class  DecisionForestClassifier
 A decision forest classifier. More...
 
class  DecisionTreeClassifier
 A decision tree classifier. More...
 
class  DepthFirstTreeBuilder
 Build a binary decision tree in depth-first order. More...
 
class  GiniCriterion
 Gini Index impurity criterion. More...
 
class  Node
 Node of a binary tree. More...
 
class  RandomState
 A random number generator. More...
 
class  Tree
 Binary tree structure build up of nodes. More...
 

Typedefs

typedef double Features_t
 
typedef long Classes_t
 
typedef double ClassWeights_t
 
typedef double Histogram_t
 
typedef unsigned long SamplesIdx_t
 
typedef unsigned long FeaturesIdx_t
 
typedef unsigned long ClassesIdx_t
 
typedef unsigned long OutputsIdx_t
 
typedef unsigned long NodesIdx_t
 
typedef unsigned long TreeDepthIdx_t
 

Functions

vector< vector< int > > create_rgb_LUT (ClassesIdx_t n_classes)
 
void process_tree_recursively_graphviz (const Tree &tree, NodesIdx_t node_id, const vector< vector< int >> &rgb_LUT, const vector< vector< string >> &classes, const vector< string > &features, bool rotate, ofstream &fout)
 
void process_tree_recursively_text (const Tree &tree, NodesIdx_t node_id, ostringstream &sout)
 
template<class X >
unsigned long maxIndex (X *x, unsigned long n)
 
template<class X , class S >
void sort2VectorsByFirstVector (std::vector< X > &x, std::vector< S > &s, long start, long end, bool increase=true)
 

Variables

auto calculate_n_classes
 
const double PRECISION_EQUAL = 1e-7
 

Typedef Documentation

◆ Classes_t

typedef long koho::Classes_t

◆ ClassesIdx_t

typedef unsigned long koho::ClassesIdx_t

◆ ClassWeights_t

typedef double koho::ClassWeights_t

◆ Features_t

typedef double koho::Features_t

◆ FeaturesIdx_t

typedef unsigned long koho::FeaturesIdx_t

◆ Histogram_t

typedef double koho::Histogram_t

◆ NodesIdx_t

typedef unsigned long koho::NodesIdx_t

◆ OutputsIdx_t

typedef unsigned long koho::OutputsIdx_t

◆ SamplesIdx_t

typedef unsigned long koho::SamplesIdx_t

◆ TreeDepthIdx_t

typedef unsigned long koho::TreeDepthIdx_t

Function Documentation

◆ create_rgb_LUT()

vector<vector<int> > koho::create_rgb_LUT ( ClassesIdx_t  n_classes)

◆ maxIndex()

template<class X >
unsigned long koho::maxIndex ( X *  x,
unsigned long  n 
)

◆ process_tree_recursively_graphviz()

void koho::process_tree_recursively_graphviz ( const Tree tree,
NodesIdx_t  node_id,
const vector< vector< int >> &  rgb_LUT,
const vector< vector< string >> &  classes,
const vector< string > &  features,
bool  rotate,
ofstream &  fout 
)

◆ process_tree_recursively_text()

void koho::process_tree_recursively_text ( const Tree tree,
NodesIdx_t  node_id,
ostringstream &  sout 
)

◆ sort2VectorsByFirstVector()

template<class X , class S >
void koho::sort2VectorsByFirstVector ( std::vector< X > &  x,
std::vector< S > &  s,
long  start,
long  end,
bool  increase = true 
)

Variable Documentation

◆ calculate_n_classes

auto koho::calculate_n_classes
Initial value:
= [](const vector<vector<string>>& classes) {
vector<ClassesIdx_t> n_classes(classes.size(), 0);
for (OutputsIdx_t o=0; o<classes.size(); o++) {
n_classes[o] = classes[o].size();
}
return n_classes;
}
unsigned long OutputsIdx_t
Definition: decision_tree.h:47

◆ PRECISION_EQUAL

const double koho::PRECISION_EQUAL = 1e-7