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

Class example is a vector of real-valued features, each identified by an integer label, plus info about to which classes the example belongs to, and with prediction storage functionalities. More...

#include <example.h>

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

List of all members.

Public Member Functions

 example (int nl)
 constructors
 example (const example &e)
 copy constructor
 example (double f1, const example &i1, double f2, const example &i2)
 new example is f1*i1 + f2*i2
double norm () const
 compute norm of example as a vector
void add_feature (int l, double v=1.0)
 update functions
int get_nlabels () const
 consultors
double get_feature_value (int label) const
int get_dimension () const
double inner_product (const example &i2) const
 compute inner product with given feature vector
void add_vector (double f, const example &i2)
 add given feature vector with given weight
void set_label (int l, bool b, double w, double pr)
 label and prediction management
void set_belongs (int l, bool b)
bool belongs (int l) const
int sign (int l) const
void set_weight (int l, double w)
double get_weight (int l) const
void set_prediction (int l, double pr)
double get_prediction (int l) const

Private Attributes

int dimension
 highest integer label
std::vector< categorylabels
 label management
int nlabels

Detailed Description

Class example is a vector of real-valued features, each identified by an integer label, plus info about to which classes the example belongs to, and with prediction storage functionalities.


Constructor & Destructor Documentation

constructors

copy constructor

freeling::example::example ( double  f1,
const example i1,
double  f2,
const example i2 
)

new example is f1*i1 + f2*i2


Member Function Documentation

void freeling::example::add_feature ( int  l,
double  v = 1.0 
)

update functions

Referenced by freeling::nec::analyze(), and freeling::bioner::analyze().

void freeling::example::add_vector ( double  f,
const example i2 
)

add given feature vector with given weight

bool freeling::example::belongs ( int  l) const
double freeling::example::get_feature_value ( int  label) const

consultors

double freeling::example::get_weight ( int  l) const
double freeling::example::inner_product ( const example i2) const

compute inner product with given feature vector

double freeling::example::norm ( ) const

compute norm of example as a vector

void freeling::example::set_belongs ( int  l,
bool  b 
)
void freeling::example::set_label ( int  l,
bool  b,
double  w,
double  pr 
)

label and prediction management

void freeling::example::set_prediction ( int  l,
double  pr 
)
void freeling::example::set_weight ( int  l,
double  w 
)

Member Data Documentation

highest integer label

std::vector<category> freeling::example::labels [private]

label management


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