PLearn 0.1
|
#include <SDBVMat.h>
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 |
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.)
typedef SDBVMFieldDiscrete PLearn::SDBVMFieldCodeAsIs::inherited [private] |
Reimplemented from PLearn::SDBVMFieldDiscrete.
PLearn::SDBVMFieldCodeAsIs::SDBVMFieldCodeAsIs | ( | SDBVMSource | source, |
int | num_classes = 0 , |
||
real | missing_values_mapping = MISSING_VALUE , |
||
SDBVMOutputCoding | oc = SDBVMNumeric , |
||
VMField::FieldType | ft = VMField::DiscrGeneral |
||
) | [inline] |
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); }