FreeLing  3.0
Public Member Functions | Private Attributes
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 example:
Inheritance graph
[legend]
Collaboration diagram for 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 ()
 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)

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

example::example ( int  nl)

constructors

example::example ( const example e)

copy constructor

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

new example is f1*i1 + f2*i2


Member Function Documentation

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

update functions

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

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

add given feature vector with given weight

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

consultors

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

compute inner product with given feature vector

double example::norm ( )

compute norm of example as a vector

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

label and prediction management

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

Member Data Documentation

int example::dimension [private]

highest integer label

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

label management

int example::nlabels [private]

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