PLearn 0.1
Public Member Functions | Private Types
PLearn::SDBVMFieldCodeAsIs Class Reference

#include <SDBVMat.h>

Inheritance diagram for PLearn::SDBVMFieldCodeAsIs:
Inheritance graph
[legend]
Collaboration diagram for PLearn::SDBVMFieldCodeAsIs:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SDBVMFieldCodeAsIs (SDBVMSource source, int num_classes=0, real missing_values_mapping=MISSING_VALUE, SDBVMOutputCoding oc=SDBVMNumeric, VMField::FieldType ft=VMField::DiscrGeneral)
virtual real getDiscreteValue (const SDBWithStats &sdb, const Row &row) const
 Perform the actual remapping.

Private Types

typedef SDBVMFieldDiscrete inherited

Detailed Description

Code a field coming from the SDB "as-is", without any modifications or remapping (except missing-value remapping). If one-hot coding is desired, a number of classes > 0 is required to be specified, and the SDB is trusted to only contain integers between 0 and num_classes-1. (If a value outside this bound is encountered, an error is reported.)

Definition at line 692 of file SDBVMat.h.


Member Typedef Documentation

Reimplemented from PLearn::SDBVMFieldDiscrete.

Definition at line 694 of file SDBVMat.h.


Constructor & Destructor Documentation

PLearn::SDBVMFieldCodeAsIs::SDBVMFieldCodeAsIs ( SDBVMSource  source,
int  num_classes = 0,
real  missing_values_mapping = MISSING_VALUE,
SDBVMOutputCoding  oc = SDBVMNumeric,
VMField::FieldType  ft = VMField::DiscrGeneral 
) [inline]

Definition at line 697 of file SDBVMat.h.

        : inherited(source, num_classes, missing_values_mapping, oc, ft) {}

Member Function Documentation

real PLearn::SDBVMFieldCodeAsIs::getDiscreteValue ( const SDBWithStats sdb,
const Row row 
) const [virtual]

Perform the actual remapping.

Implements PLearn::SDBVMFieldDiscrete.

Definition at line 659 of file SDBVMat.cc.

References PLearn::SDBVMSource::getValue(), PLearn::FieldValue::isMissing(), PLearn::SDBVMField::missing_values_mapping_, and PLearn::SDBVMFieldSource1::source_.

{
    FieldValue v = source_.getValue(sdb,row);
    return v.isMissing() ?missing_values_mapping_ :real(v);
}

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines