FreeLing  4.0
Public Member Functions | Private Member Functions | Private Attributes
freeling::mlDTree Class Reference

Class mlDTree implements a multilabel decision tree that can be used by adaboost as a weak rules. More...

#include <weakrule.h>

Inheritance diagram for freeling::mlDTree:
Inheritance graph
[legend]
Collaboration diagram for freeling::mlDTree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 mlDTree (mlDTree_params *p)
void classify (const example &i, double pred[])
 Classification Important: pred is an array of predictions, one for each label the function *adds* its predicion for each label.
void write_to_stream (std::wostream *os)
 I/O operations.
void read_from_stream (std::wistream *is)
 I/O operations.
void learn (const dataset &ds, double &Z)
 Learning.

Private Member Functions

void classify (const example &i, double pred[], tree< dt_node >::iterator t)
 auxiliar classifying function
void write_to_stream (tree< dt_node >::iterator t, std::wostream *os)
 auxiliar I/O functions
tree< dt_noderead_dt (std::wistream *is)
tree< dt_nodelearn (const dataset &ds, double &Z, int depth)
 auxiliar learning functions
bool stopping_criterion (const dataset &ds, int depth)
int best_feature (const dataset &ds, double *W)
 W is W[2][nlabels][2].
void Cprediction (int v, double *W, double result[])
 W is W[v][nlabels][2]; result is result[nlabels].
double Zcalculus (double *W, int ndim)
 We will re-use Z computed during decision-tree building so we ignore default Zcalculus and do it our way.
 mlDTree (const mlDTree &wr0)
 copy constructor forbidden

Private Attributes

mlDTree_params params
tree< dt_noderule
std::set< intused_features

Detailed Description

Class mlDTree implements a multilabel decision tree that can be used by adaboost as a weak rules.


Constructor & Destructor Documentation

freeling::mlDTree::mlDTree ( const mlDTree wr0) [private]

copy constructor forbidden


Member Function Documentation

int freeling::mlDTree::best_feature ( const dataset ds,
double *  W 
) [private]

W is W[2][nlabels][2].

void freeling::mlDTree::classify ( const example i,
double  pred[],
tree< dt_node >::iterator  t 
) [private]

auxiliar classifying function

void freeling::mlDTree::classify ( const example i,
double  pred[] 
) [virtual]

Classification Important: pred is an array of predictions, one for each label the function *adds* its predicion for each label.

Implements freeling::weak_rule.

void freeling::mlDTree::Cprediction ( int  v,
double *  W,
double  result[] 
) [private]

W is W[v][nlabels][2]; result is result[nlabels].

tree<dt_node> freeling::mlDTree::learn ( const dataset ds,
double &  Z,
int  depth 
) [private]

auxiliar learning functions

void freeling::mlDTree::learn ( const dataset ds,
double &  Z 
) [virtual]

Learning.

Implements freeling::weak_rule.

tree<dt_node> freeling::mlDTree::read_dt ( std::wistream *  is) [private]
void freeling::mlDTree::read_from_stream ( std::wistream *  is) [virtual]

I/O operations.

Implements freeling::weak_rule.

bool freeling::mlDTree::stopping_criterion ( const dataset ds,
int  depth 
) [private]
void freeling::mlDTree::write_to_stream ( tree< dt_node >::iterator  t,
std::wostream *  os 
) [private]

auxiliar I/O functions

void freeling::mlDTree::write_to_stream ( std::wostream *  os) [virtual]

I/O operations.

Implements freeling::weak_rule.

double freeling::mlDTree::Zcalculus ( double *  W,
int  ndim 
) [private]

We will re-use Z computed during decision-tree building so we ignore default Zcalculus and do it our way.

W is W[ndim][nlabels][2]


Member Data Documentation


The documentation for this class was generated from the following file: