|
FreeLing
4.0
|
Class mlDTree implements a multilabel decision tree that can be used by adaboost as a weak rules. More...
#include <weakrule.h>


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_node > | read_dt (std::wistream *is) |
| tree< dt_node > | learn (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_node > | rule |
| std::set< int > | used_features |
Class mlDTree implements a multilabel decision tree that can be used by adaboost as a weak rules.
| freeling::mlDTree::mlDTree | ( | const mlDTree & | wr0 | ) | [private] |
copy constructor forbidden
| 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]
mlDTree_params freeling::mlDTree::params [private] |
tree<dt_node> freeling::mlDTree::rule [private] |
std::set<int> freeling::mlDTree::used_features [private] |
1.7.6.1